forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed SoftwareOutputDevice interface.
+ Some of the necessary changes to the renderer for software compositing. BUG=124671, 161008 Review URL: https://chromiumcodereview.appspot.com/12379055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186310 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
skaslev@chromium.org
committed
Mar 6, 2013
1 parent
8be1c58
commit bd3d1ce
Showing
30 changed files
with
283 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "cc/software_frame_data.h" | ||
|
||
namespace cc { | ||
|
||
SoftwareFrameData::SoftwareFrameData() | ||
: content_dib(TransportDIB::DefaultHandleValue()) { | ||
} | ||
|
||
SoftwareFrameData::~SoftwareFrameData() {} | ||
|
||
} // namespace cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CC_SOFTWARE_FRAME_DATA_H_ | ||
#define CC_SOFTWARE_FRAME_DATA_H_ | ||
|
||
#include "base/basictypes.h" | ||
#include "cc/cc_export.h" | ||
#include "ui/gfx/rect.h" | ||
#include "ui/surface/transport_dib.h" | ||
|
||
namespace cc { | ||
|
||
class CC_EXPORT SoftwareFrameData { | ||
public: | ||
SoftwareFrameData(); | ||
~SoftwareFrameData(); | ||
|
||
gfx::Rect damage_rect; | ||
TransportDIB::Handle content_dib; | ||
}; | ||
|
||
} // namespace cc | ||
|
||
#endif // CC_SOFTWARE_FRAME_DATA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "cc/software_output_device.h" | ||
|
||
#include "base/logging.h" | ||
#include "cc/software_frame_data.h" | ||
#include "third_party/skia/include/core/SkCanvas.h" | ||
#include "third_party/skia/include/core/SkDevice.h" | ||
|
||
namespace cc { | ||
|
||
SoftwareOutputDevice::SoftwareOutputDevice() {} | ||
|
||
SoftwareOutputDevice::~SoftwareOutputDevice() {} | ||
|
||
void SoftwareOutputDevice::Resize(const gfx::Size& viewport_size) { | ||
if (viewport_size_ == viewport_size) | ||
return; | ||
|
||
viewport_size_ = viewport_size; | ||
device_ = skia::AdoptRef(new SkDevice(SkBitmap::kARGB_8888_Config, | ||
viewport_size.width(), viewport_size.height(), true)); | ||
canvas_ = skia::AdoptRef(new SkCanvas(device_.get())); | ||
} | ||
|
||
SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) { | ||
DCHECK(device_); | ||
damage_rect_ = damage_rect; | ||
return canvas_.get(); | ||
} | ||
|
||
void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) { | ||
DCHECK(device_); | ||
if (frame_data) { | ||
frame_data->damage_rect = damage_rect_; | ||
frame_data->content_dib = TransportDIB::DefaultHandleValue(); | ||
} | ||
} | ||
|
||
void SoftwareOutputDevice::CopyToBitmap( | ||
const gfx::Rect& rect, SkBitmap* output) { | ||
DCHECK(device_); | ||
SkIRect invertRect = SkIRect::MakeXYWH( | ||
rect.x(), viewport_size_.height() - rect.bottom(), | ||
rect.width(), rect.height()); | ||
const SkBitmap& bitmap = device_->accessBitmap(false); | ||
bitmap.extractSubset(output, invertRect); | ||
} | ||
|
||
void SoftwareOutputDevice::Scroll( | ||
const gfx::Vector2d& delta, const gfx::Rect& clip_rect) { | ||
NOTIMPLEMENTED(); | ||
} | ||
|
||
void SoftwareOutputDevice::ReclaimDIB(TransportDIB::Handle handle) { | ||
NOTIMPLEMENTED(); | ||
} | ||
|
||
} // namespace cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.