Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2239)

Side by Side Diff: cc/blink/web_image_layer_impl.cc

Issue 2835373003: Plumb PaintImage to the PictureImageLayer. (Closed)
Patch Set: update Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/blink/web_image_layer_impl.h ('k') | cc/layers/picture_image_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/blink/web_image_layer_impl.h" 5 #include "cc/blink/web_image_layer_impl.h"
6 6
7 #include "cc/blink/web_layer_impl.h" 7 #include "cc/blink/web_layer_impl.h"
8 #include "cc/blink/web_layer_impl_fixed_bounds.h" 8 #include "cc/blink/web_layer_impl_fixed_bounds.h"
9 #include "cc/layers/picture_image_layer.h" 9 #include "cc/layers/picture_image_layer.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
11 11
12 namespace cc_blink { 12 namespace cc_blink {
13 13
14 WebImageLayerImpl::WebImageLayerImpl() { 14 WebImageLayerImpl::WebImageLayerImpl() {
15 layer_.reset(new WebLayerImplFixedBounds(cc::PictureImageLayer::Create())); 15 layer_.reset(new WebLayerImplFixedBounds(cc::PictureImageLayer::Create()));
16 } 16 }
17 17
18 WebImageLayerImpl::~WebImageLayerImpl() { 18 WebImageLayerImpl::~WebImageLayerImpl() {
19 } 19 }
20 20
21 blink::WebLayer* WebImageLayerImpl::Layer() { 21 blink::WebLayer* WebImageLayerImpl::Layer() {
22 return layer_.get(); 22 return layer_.get();
23 } 23 }
24 24
25 void WebImageLayerImpl::SetImage(const SkImage* image) { 25 void WebImageLayerImpl::SetImage(cc::PaintImage image) {
26 static_cast<WebLayerImplFixedBounds*>(layer_.get())
27 ->SetFixedBounds(
28 gfx::Size(image.sk_image()->width(), image.sk_image()->height()));
26 static_cast<cc::PictureImageLayer*>(layer_->layer()) 29 static_cast<cc::PictureImageLayer*>(layer_->layer())
27 ->SetImage(sk_ref_sp(image)); 30 ->SetImage(std::move(image));
28 static_cast<WebLayerImplFixedBounds*>(layer_.get())
29 ->SetFixedBounds(gfx::Size(image->width(), image->height()));
30 } 31 }
31 32
32 void WebImageLayerImpl::SetNearestNeighbor(bool nearest_neighbor) { 33 void WebImageLayerImpl::SetNearestNeighbor(bool nearest_neighbor) {
33 static_cast<cc::PictureImageLayer*>(layer_->layer()) 34 static_cast<cc::PictureImageLayer*>(layer_->layer())
34 ->SetNearestNeighbor(nearest_neighbor); 35 ->SetNearestNeighbor(nearest_neighbor);
35 } 36 }
36 37
37 } // namespace cc_blink 38 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_image_layer_impl.h ('k') | cc/layers/picture_image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698