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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1915943002: simplify handle-affine: subclass overrides just describe their leaf behavior (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: early out if onCanHandleComplexCTM returns false 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 | « src/core/SkCanvas.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | 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 6c73be29b59ff7bb0c5f7550b874854474c34853..ab1758844c9c6acf8c9496b9da188f939e4e6cde 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -330,22 +330,18 @@ bool SkImageFilter::asAColorFilter(SkColorFilter** filterPtr) const {
return true;
}
-bool SkImageFilter::onCanHandleAffine() const {
- bool hasInputs = false;
-
+bool SkImageFilter::canHandleComplexCTM() const {
+ if (!this->onCanHandleComplexCTM()) {
+ return false;
+ }
const int count = this->countInputs();
for (int i = 0; i < count; ++i) {
SkImageFilter* input = this->getInput(i);
- if (input) {
- if (!input->canHandleAffine()) {
- return false;
- }
- hasInputs = true;
+ if (input && !input->canHandleComplexCTM()) {
+ return false;
}
}
- // We return true iff we had 1 or more inputs, and all of them can handle affine.
- // If we have no inputs, or 1 or more of them do not handle affine, then we return false.
- return hasInputs;
+ return true;
}
bool SkImageFilter::applyCropRect(const Context& ctx, const SkIRect& srcBounds,
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698