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

Side by Side Diff: src/effects/SkColorFilterImageFilter.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, 7 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 unified diff | Download patch
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 SkASSERT(1 == this->countInputs()); 119 SkASSERT(1 == this->countInputs());
120 if (!this->cropRectIsSet()) { 120 if (!this->cropRectIsSet()) {
121 if (filter) { 121 if (filter) {
122 *filter = SkRef(fColorFilter.get()); 122 *filter = SkRef(fColorFilter.get());
123 } 123 }
124 return true; 124 return true;
125 } 125 }
126 return false; 126 return false;
127 } 127 }
128 128
129 bool SkColorFilterImageFilter::onCanHandleAffine() const {
130 SkASSERT(1 == this->countInputs());
131 SkImageFilter* input = this->getInput(0);
132 return !input || input->canHandleAffine();
133 }
134
135 bool SkColorFilterImageFilter::affectsTransparentBlack() const { 129 bool SkColorFilterImageFilter::affectsTransparentBlack() const {
136 return fColorFilter->affectsTransparentBlack(); 130 return fColorFilter->affectsTransparentBlack();
137 } 131 }
138 132
139 #ifndef SK_IGNORE_TO_STRING 133 #ifndef SK_IGNORE_TO_STRING
140 void SkColorFilterImageFilter::toString(SkString* str) const { 134 void SkColorFilterImageFilter::toString(SkString* str) const {
141 str->appendf("SkColorFilterImageFilter: ("); 135 str->appendf("SkColorFilterImageFilter: (");
142 136
143 str->appendf("input: ("); 137 str->appendf("input: (");
144 138
145 if (this->getInput(0)) { 139 if (this->getInput(0)) {
146 this->getInput(0)->toString(str); 140 this->getInput(0)->toString(str);
147 } 141 }
148 142
149 str->appendf(") color filter: "); 143 str->appendf(") color filter: ");
150 fColorFilter->toString(str); 144 fColorFilter->toString(str);
151 145
152 str->append(")"); 146 str->append(")");
153 } 147 }
154 #endif 148 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698