diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-06-18 14:10:49 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-06-18 13:53:24 +0000 |
commit | 813fbf95af77a531c57a8c497345ad2c61d475b3 (patch) | |
tree | 821b2c8de8365f21b6c9ba17a236fb3006a1d506 /chromium/cc/layers/picture_image_layer.cc | |
parent | af6588f8d723931a298c995fa97259bb7f7deb55 (diff) |
BASELINE: Update chromium to 44.0.2403.47
Change-Id: Ie056fedba95cf5e5c76b30c4b2c80fca4764aa2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/cc/layers/picture_image_layer.cc')
-rw-r--r-- | chromium/cc/layers/picture_image_layer.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/chromium/cc/layers/picture_image_layer.cc b/chromium/cc/layers/picture_image_layer.cc index dba506ec843..345ee2b4e95 100644 --- a/chromium/cc/layers/picture_image_layer.cc +++ b/chromium/cc/layers/picture_image_layer.cc @@ -5,7 +5,10 @@ #include "cc/layers/picture_image_layer.h" #include "cc/layers/picture_image_layer_impl.h" +#include "cc/playback/drawing_display_item.h" #include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "ui/gfx/skia_util.h" namespace cc { @@ -21,7 +24,7 @@ PictureImageLayer::~PictureImageLayer() { scoped_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) { - return PictureImageLayerImpl::Create(tree_impl, id()); + return PictureImageLayerImpl::Create(tree_impl, id(), is_mask()); } bool PictureImageLayer::HasDrawableContent() const { @@ -44,7 +47,7 @@ void PictureImageLayer::SetBitmap(const SkBitmap& bitmap) { void PictureImageLayer::PaintContents( SkCanvas* canvas, const gfx::Rect& clip, - ContentLayerClient::GraphicsContextStatus gc_status) { + ContentLayerClient::PaintingControlSetting painting_control) { if (!bitmap_.width() || !bitmap_.height()) return; @@ -60,6 +63,20 @@ void PictureImageLayer::PaintContents( canvas->drawBitmap(bitmap_, 0, 0); } +void PictureImageLayer::PaintContentsToDisplayList( + DisplayItemList* display_list, + const gfx::Rect& clip, + ContentLayerClient::PaintingControlSetting painting_control) { + SkPictureRecorder recorder; + SkCanvas* canvas = recorder.beginRecording(gfx::RectToSkRect(clip)); + PaintContents(canvas, clip, painting_control); + + skia::RefPtr<SkPicture> picture = + skia::AdoptRef(recorder.endRecordingAsPicture()); + auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); + item->SetNew(picture.Pass()); +} + bool PictureImageLayer::FillsBoundsCompletely() const { return false; } |