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

Side by Side Diff: src/effects/SkColorFilterImageFilter.cpp

Issue 1908173006: allow imagefilter to manage CTM decomposition (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: switch to simple canHandleAffine pattern 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 unified diff | Download patch
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
129 bool SkColorFilterImageFilter::affectsTransparentBlack() const { 135 bool SkColorFilterImageFilter::affectsTransparentBlack() const {
130 return fColorFilter->affectsTransparentBlack(); 136 return fColorFilter->affectsTransparentBlack();
131 } 137 }
132 138
133 #ifndef SK_IGNORE_TO_STRING 139 #ifndef SK_IGNORE_TO_STRING
134 void SkColorFilterImageFilter::toString(SkString* str) const { 140 void SkColorFilterImageFilter::toString(SkString* str) const {
135 str->appendf("SkColorFilterImageFilter: ("); 141 str->appendf("SkColorFilterImageFilter: (");
136 142
137 str->appendf("input: ("); 143 str->appendf("input: (");
138 144
139 if (this->getInput(0)) { 145 if (this->getInput(0)) {
140 this->getInput(0)->toString(str); 146 this->getInput(0)->toString(str);
141 } 147 }
142 148
143 str->appendf(") color filter: "); 149 str->appendf(") color filter: ");
144 fColorFilter->toString(str); 150 fColorFilter->toString(str);
145 151
146 str->append(")"); 152 str->append(")");
147 } 153 }
148 #endif 154 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698