diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-17 13:57:45 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-19 13:44:40 +0000 |
commit | 6ec7b8da05d21a3878bd21c691b41e675d74bb1c (patch) | |
tree | b87f250bc19413750b9bb9cdbf2da20ef5014820 /chromium/cc/layers/picture_image_layer.cc | |
parent | ec02ee4181c49b61fce1c8fb99292dbb8139cc90 (diff) |
BASELINE: Update Chromium to 60.0.3112.70
Change-Id: I9911c2280a014d4632f254857876a395d4baed2d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/cc/layers/picture_image_layer.cc')
-rw-r--r-- | chromium/cc/layers/picture_image_layer.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chromium/cc/layers/picture_image_layer.cc b/chromium/cc/layers/picture_image_layer.cc index c219d8d906d..327582e8748 100644 --- a/chromium/cc/layers/picture_image_layer.cc +++ b/chromium/cc/layers/picture_image_layer.cc @@ -33,15 +33,15 @@ std::unique_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl( } bool PictureImageLayer::HasDrawableContent() const { - return image_ && PictureLayer::HasDrawableContent(); + return image_.sk_image() && PictureLayer::HasDrawableContent(); } -void PictureImageLayer::SetImage(sk_sp<const SkImage> image) { +void PictureImageLayer::SetImage(PaintImage image) { // SetImage() currently gets called whenever there is any // style change that affects the layer even if that change doesn't // affect the actual contents of the image (e.g. a CSS animation). // With this check in place we avoid unecessary texture uploads. - if (image_.get() == image.get()) + if (image_ == image) return; image_ = std::move(image); @@ -55,9 +55,9 @@ gfx::Rect PictureImageLayer::PaintableRegion() { scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList( ContentLayerClient::PaintingControlSetting painting_control) { - DCHECK(image_); - DCHECK_GT(image_->width(), 0); - DCHECK_GT(image_->height(), 0); + DCHECK(image_.sk_image()); + DCHECK_GT(image_.sk_image()->width(), 0); + DCHECK_GT(image_.sk_image()->height(), 0); DCHECK(layer_tree_host()); auto display_list = make_scoped_refptr(new DisplayItemList); @@ -66,10 +66,10 @@ scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList( PaintCanvas* canvas = recorder.beginRecording(gfx::RectToSkRect(PaintableRegion())); - SkScalar content_to_layer_scale_x = - SkFloatToScalar(static_cast<float>(bounds().width()) / image_->width()); - SkScalar content_to_layer_scale_y = - SkFloatToScalar(static_cast<float>(bounds().height()) / image_->height()); + SkScalar content_to_layer_scale_x = SkFloatToScalar( + static_cast<float>(bounds().width()) / image_.sk_image()->width()); + SkScalar content_to_layer_scale_y = SkFloatToScalar( + static_cast<float>(bounds().height()) / image_.sk_image()->height()); canvas->scale(content_to_layer_scale_x, content_to_layer_scale_y); // Because Android WebView resourceless software draw mode rasters directly @@ -78,7 +78,8 @@ scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList( canvas->drawImage(image_, 0, 0); display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( - PaintableRegion(), recorder.finishRecordingAsPicture()); + PaintableRegion(), recorder.finishRecordingAsPicture(), + gfx::RectToSkRect(PaintableRegion())); display_list->Finalize(); return display_list; |