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

Unified Diff: third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp

Issue 1829093002: Use sk_sp-based APIs for SkColorFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to reviews Created 4 years, 9 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
Index: third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp
index 8c09a88049f85c9a8415e881d57def5cc09468a3..5c442492adf2ae4524dbf912155dfacffba42c30 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp
@@ -118,7 +118,7 @@ static void luminanceToAlphaMatrix(SkScalar matrix[kColorMatrixSize])
matrix[17] = 0.0721f;
}
-static SkColorFilter* createColorFilter(ColorMatrixType type, const Vector<float>& values)
+static sk_sp<SkColorFilter> createColorFilter(ColorMatrixType type, const Vector<float>& values)
{
// Use defaults if values contains too few/many values.
SkScalar matrix[kColorMatrixSize];
@@ -150,7 +150,7 @@ static SkColorFilter* createColorFilter(ColorMatrixType type, const Vector<float
luminanceToAlphaMatrix(matrix);
break;
}
- return SkColorMatrixFilter::Create(matrix);
+ return SkColorFilter::MakeMatrixFilterRowMajor255(matrix);
}
bool FEColorMatrix::affectsTransparentPixels()
@@ -163,9 +163,9 @@ bool FEColorMatrix::affectsTransparentPixels()
PassRefPtr<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilder& builder)
{
RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace()));
- SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values));
+ sk_sp<SkColorFilter> filter = createColorFilter(m_type, m_values);
SkImageFilter::CropRect rect = getCropRect();
- return adoptRef(SkColorFilterImageFilter::Create(filter, input.get(), &rect));
+ return adoptRef(SkColorFilterImageFilter::Create(filter.get(), input.get(), &rect));
}
static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type)

Powered by Google App Engine
This is Rietveld 408576698