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

Side by Side Diff: cc/layers/picture_image_layer.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/layers/picture_image_layer.h ('k') | cc/layers/picture_image_layer_unittest.cc » ('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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/picture_image_layer.h" 5 #include "cc/layers/picture_image_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/picture_image_layer_impl.h" 9 #include "cc/layers/picture_image_layer_impl.h"
10 #include "cc/playback/display_item_list_settings.h" 10 #include "cc/playback/display_item_list_settings.h"
(...skipping 18 matching lines...) Expand all
29 29
30 std::unique_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl( 30 std::unique_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl(
31 LayerTreeImpl* tree_impl) { 31 LayerTreeImpl* tree_impl) {
32 return PictureImageLayerImpl::Create(tree_impl, id(), is_mask()); 32 return PictureImageLayerImpl::Create(tree_impl, id(), is_mask());
33 } 33 }
34 34
35 bool PictureImageLayer::HasDrawableContent() const { 35 bool PictureImageLayer::HasDrawableContent() const {
36 return image_ && PictureLayer::HasDrawableContent(); 36 return image_ && PictureLayer::HasDrawableContent();
37 } 37 }
38 38
39 void PictureImageLayer::SetImage(skia::RefPtr<const SkImage> image) { 39 void PictureImageLayer::SetImage(sk_sp<const SkImage> image) {
40 // SetImage() currently gets called whenever there is any 40 // SetImage() currently gets called whenever there is any
41 // style change that affects the layer even if that change doesn't 41 // style change that affects the layer even if that change doesn't
42 // affect the actual contents of the image (e.g. a CSS animation). 42 // affect the actual contents of the image (e.g. a CSS animation).
43 // With this check in place we avoid unecessary texture uploads. 43 // With this check in place we avoid unecessary texture uploads.
44 if (image_.get() == image.get()) 44 if (image_.get() == image.get())
45 return; 45 return;
46 46
47 image_ = std::move(image); 47 image_ = std::move(image);
48 UpdateDrawsContent(HasDrawableContent()); 48 UpdateDrawsContent(HasDrawableContent());
49 SetNeedsDisplay(); 49 SetNeedsDisplay();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 bool PictureImageLayer::FillsBoundsCompletely() const { 91 bool PictureImageLayer::FillsBoundsCompletely() const {
92 return false; 92 return false;
93 } 93 }
94 94
95 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { 95 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const {
96 return 0; 96 return 0;
97 } 97 }
98 98
99 } // namespace cc 99 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer.h ('k') | cc/layers/picture_image_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698