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

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

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 years 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 | « include/gpu/GrXferProcessor.h ('k') | src/effects/SkBlurMaskFilter.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 bool AlphaThresholdEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 225 bool AlphaThresholdEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
226 const AlphaThresholdEffect& s = sBase.cast<AlphaThresholdEffect>(); 226 const AlphaThresholdEffect& s = sBase.cast<AlphaThresholdEffect>();
227 return (this->fInnerThreshold == s.fInnerThreshold && 227 return (this->fInnerThreshold == s.fInnerThreshold &&
228 this->fOuterThreshold == s.fOuterThreshold); 228 this->fOuterThreshold == s.fOuterThreshold);
229 } 229 }
230 230
231 void AlphaThresholdEffect::onComputeInvariantOutput(GrInvariantOutput* inout) co nst { 231 void AlphaThresholdEffect::onComputeInvariantOutput(GrInvariantOutput* inout) co nst {
232 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { 232 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
233 inout->mulByUnknownSingleComponent(); 233 inout->mulByUnknownAlpha();
234 } else if (GrPixelConfigIsOpaque(this->texture(0)->config()) && fOuterThresh old >= 1.f) { 234 } else if (GrPixelConfigIsOpaque(this->texture(0)->config()) && fOuterThresh old >= 1.f) {
235 inout->mulByUnknownOpaqueFourComponents(); 235 inout->mulByUnknownOpaqueColor();
236 } else { 236 } else {
237 inout->mulByUnknownFourComponents(); 237 inout->mulByUnknownColor();
238 } 238 }
239 } 239 }
240 240
241 #endif 241 #endif
242 242
243 SkFlattenable* SkAlphaThresholdFilterImpl::CreateProc(SkReadBuffer& buffer) { 243 SkFlattenable* SkAlphaThresholdFilterImpl::CreateProc(SkReadBuffer& buffer) {
244 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 244 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
245 SkScalar inner = buffer.readScalar(); 245 SkScalar inner = buffer.readScalar();
246 SkScalar outer = buffer.readScalar(); 246 SkScalar outer = buffer.readScalar();
247 SkRegion rgn; 247 SkRegion rgn;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 (U8CPU)(SkColorGetG(source) * scale), 371 (U8CPU)(SkColorGetG(source) * scale),
372 (U8CPU)(SkColorGetB(source) * scale)); 372 (U8CPU)(SkColorGetB(source) * scale));
373 } 373 }
374 } 374 }
375 dptr[y * dst->width() + x] = output_color; 375 dptr[y * dst->width() + x] = output_color;
376 } 376 }
377 } 377 }
378 378
379 return true; 379 return true;
380 } 380 }
OLDNEW
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698