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

Unified Diff: cc/trees/layer_tree_host_pixeltest_masks.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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_filters.cc ('k') | cc/trees/layer_tree_host_pixeltest_tiles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_pixeltest_masks.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 4b950136cb0ddb955a6dc6194153b1ea1195ea0b..a6380781470288179aefc0b7fad02666a45ad2e1 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -39,7 +39,7 @@ class MaskContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
SkPictureRecorder recorder;
- skia::RefPtr<SkCanvas> canvas = skia::SharePtr(
+ sk_sp<SkCanvas> canvas = sk_ref_sp(
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_))));
SkPaint paint;
@@ -110,9 +110,7 @@ TEST_P(LayerTreeHostMasksPixelTest, ImageMaskOfLayer) {
client.PaintContentsToDisplayList(
ContentLayerClient::PAINTING_BEHAVIOR_NORMAL);
mask_display_list->Raster(canvas, nullptr, gfx::Rect(mask_bounds), 1.0f);
- skia::RefPtr<const SkImage> image =
- skia::AdoptRef(surface->newImageSnapshot());
- mask->SetImage(std::move(image));
+ mask->SetImage(surface->makeImageSnapshot());
scoped_refptr<SolidColorLayer> green = CreateSolidColorLayerWithBorder(
gfx::Rect(25, 25, 50, 50), kCSSGreen, 1, SK_ColorBLACK);
@@ -307,7 +305,7 @@ class CheckerContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
SkPictureRecorder recorder;
- skia::RefPtr<SkCanvas> canvas = skia::SharePtr(
+ sk_sp<SkCanvas> canvas = sk_ref_sp(
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_))));
SkPaint paint;
@@ -351,7 +349,7 @@ class CircleContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
SkPictureRecorder recorder;
- skia::RefPtr<SkCanvas> canvas = skia::SharePtr(
+ sk_sp<SkCanvas> canvas = sk_ref_sp(
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_))));
SkPaint paint;
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_filters.cc ('k') | cc/trees/layer_tree_host_pixeltest_tiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698