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

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

Issue 1869753003: Replace many skia::RefPtr with sk_sp<> in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Florin's nits Created 4 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/animation/animation_player.cc ('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(const SkImage* image) {
26 skia::RefPtr<const SkImage> imageRef = skia::SharePtr(image);
27 static_cast<cc::PictureImageLayer*>(layer_->layer()) 26 static_cast<cc::PictureImageLayer*>(layer_->layer())
28 ->SetImage(std::move(imageRef)); 27 ->SetImage(sk_ref_sp(image));
29 static_cast<WebLayerImplFixedBounds*>(layer_.get()) 28 static_cast<WebLayerImplFixedBounds*>(layer_.get())
30 ->SetFixedBounds(gfx::Size(image->width(), image->height())); 29 ->SetFixedBounds(gfx::Size(image->width(), image->height()));
31 } 30 }
32 31
33 void WebImageLayerImpl::setNearestNeighbor(bool nearest_neighbor) { 32 void WebImageLayerImpl::setNearestNeighbor(bool nearest_neighbor) {
34 static_cast<cc::PictureImageLayer*>(layer_->layer()) 33 static_cast<cc::PictureImageLayer*>(layer_->layer())
35 ->SetNearestNeighbor(nearest_neighbor); 34 ->SetNearestNeighbor(nearest_neighbor);
36 } 35 }
37 36
38 } // namespace cc_blink 37 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/animation/animation_player.cc ('k') | cc/layers/picture_image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698