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

Unified Diff: cc/trees/layer_tree_host_pixeltest_filters.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_blending.cc ('k') | cc/trees/layer_tree_host_pixeltest_masks.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_filters.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_filters.cc b/cc/trees/layer_tree_host_pixeltest_filters.cc
index db7e70c2e405e99c2cbcedb779acccec2c6514da..135c4fda9f2da69473c62ff43a78cb5a95e0364a 100644
--- a/cc/trees/layer_tree_host_pixeltest_filters.cc
+++ b/cc/trees/layer_tree_host_pixeltest_filters.cc
@@ -246,12 +246,11 @@ class ImageFilterClippedPixelTest : public LayerTreeHostFiltersPixelTest {
matrix[2] = matrix[6] = matrix[10] = matrix[18] = SK_Scalar1;
// We filter only the bottom 200x100 pixels of the foreground.
SkImageFilter::CropRect crop_rect(SkRect::MakeXYWH(0, 100, 200, 100));
- sk_sp<SkColorFilter> color_filter =
- SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
- skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(
- SkColorFilterImageFilter::Create(color_filter.get(), NULL, &crop_rect));
FilterOperations filters;
- filters.Append(FilterOperation::CreateReferenceFilter(filter));
+ filters.Append(
+ FilterOperation::CreateReferenceFilter(SkColorFilterImageFilter::Make(
+ SkColorFilter::MakeMatrixFilterRowMajor255(matrix), nullptr,
+ &crop_rect)));
// Make the foreground layer's render surface be clipped by the background
// layer.
@@ -561,9 +560,8 @@ class EnlargedTextureWithCropOffsetFilter
FilterOperations filters;
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(10, 10, 80, 80));
- skia::RefPtr<SkImageFilter> filter(
- skia::AdoptRef(SkOffsetImageFilter::Create(0, 0, nullptr, &cropRect)));
- filters.Append(FilterOperation::CreateReferenceFilter(filter));
+ filters.Append(FilterOperation::CreateReferenceFilter(
+ SkOffsetImageFilter::Make(0, 0, nullptr, &cropRect)));
filter_layer->SetFilters(filters);
background->AddChild(filter_layer);
@@ -607,12 +605,10 @@ class FilterWithGiantCropRectPixelTest : public LayerTreeHostFiltersPixelTest {
FilterOperations filters;
SkImageFilter::CropRect cropRect(
SkRect::MakeXYWH(-40000, -40000, 80000, 80000));
- sk_sp<SkColorFilter> color_filter =
- SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
- skia::RefPtr<SkImageFilter> filter(
- skia::AdoptRef(SkColorFilterImageFilter::Create(color_filter.get(),
- nullptr, &cropRect)));
- filters.Append(FilterOperation::CreateReferenceFilter(filter));
+ filters.Append(
+ FilterOperation::CreateReferenceFilter((SkColorFilterImageFilter::Make(
+ SkColorFilter::MakeMatrixFilterRowMajor255(matrix), nullptr,
+ &cropRect))));
filter_layer->SetFilters(filters);
background->SetMasksToBounds(masks_to_bounds);
background->AddChild(filter_layer);
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_blending.cc ('k') | cc/trees/layer_tree_host_pixeltest_masks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698