summaryrefslogtreecommitdiffstats
path: root/chromium/cc/layers/picture_image_layer.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-08-14 11:38:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-08-14 17:16:47 +0000
commit3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859 (patch)
tree43cc572ba067417c7341db81f71ae7cc6e0fcc3e /chromium/cc/layers/picture_image_layer.cc
parentf61ab1ac7f855cd281809255c0aedbb1895e1823 (diff)
BASELINE: Update chromium to 45.0.2454.40
Change-Id: Id2121d9f11a8fc633677236c65a3e41feef589e4 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/cc/layers/picture_image_layer.cc')
-rw-r--r--chromium/cc/layers/picture_image_layer.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/chromium/cc/layers/picture_image_layer.cc b/chromium/cc/layers/picture_image_layer.cc
index 345ee2b4e95..6d903bd40bc 100644
--- a/chromium/cc/layers/picture_image_layer.cc
+++ b/chromium/cc/layers/picture_image_layer.cc
@@ -12,11 +12,14 @@
namespace cc {
-scoped_refptr<PictureImageLayer> PictureImageLayer::Create() {
- return make_scoped_refptr(new PictureImageLayer());
+scoped_refptr<PictureImageLayer> PictureImageLayer::Create(
+ const LayerSettings& settings) {
+ return make_scoped_refptr(new PictureImageLayer(settings));
}
-PictureImageLayer::PictureImageLayer() : PictureLayer(this) {}
+PictureImageLayer::PictureImageLayer(const LayerSettings& settings)
+ : PictureLayer(settings, this) {
+}
PictureImageLayer::~PictureImageLayer() {
ClearClient();
@@ -63,10 +66,15 @@ void PictureImageLayer::PaintContents(
canvas->drawBitmap(bitmap_, 0, 0);
}
-void PictureImageLayer::PaintContentsToDisplayList(
- DisplayItemList* display_list,
+scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList(
const gfx::Rect& clip,
ContentLayerClient::PaintingControlSetting painting_control) {
+ // Picture image layers can be used with GatherPixelRefs, so cached SkPictures
+ // are currently required.
+ const bool use_cached_picture = true;
+ scoped_refptr<DisplayItemList> display_list =
+ DisplayItemList::Create(clip, use_cached_picture);
+
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(gfx::RectToSkRect(clip));
PaintContents(canvas, clip, painting_control);
@@ -75,6 +83,9 @@ void PictureImageLayer::PaintContentsToDisplayList(
skia::AdoptRef(recorder.endRecordingAsPicture());
auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>();
item->SetNew(picture.Pass());
+
+ display_list->Finalize();
+ return display_list;
}
bool PictureImageLayer::FillsBoundsCompletely() const {