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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1402133002: change back to method for localmatrix imagefilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment for const-cast Created 5 years, 2 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 | « include/core/SkImageFilter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 43adc2fad5b8303c39febd9839b40dfa0dca2fcb..3f6ea9a12becd54e339ffa15970a7f421bc9d2f9 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -440,9 +440,11 @@ SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix,
return SkMatrixImageFilter::Create(matrix, filterQuality, input);
}
-SkImageFilter* SkImageFilter::CreateLocalMatrixFilter(const SkMatrix& matrix,
- SkImageFilter* input) {
- return SkLocalMatrixImageFilter::Create(matrix, input);
+SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const {
+ // SkLocalMatrixImageFilter takes SkImage* in its factory, but logically that parameter
+ // is *always* treated as a const ptr. Hence the const-cast here.
+ //
+ return SkLocalMatrixImageFilter::Create(matrix, const_cast<SkImageFilter*>(this));
}
#if SK_SUPPORT_GPU
« no previous file with comments | « include/core/SkImageFilter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698