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

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

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkColorMatrixFilter.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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 SkXfermode::Coeff dstCoeff; 279 SkXfermode::Coeff dstCoeff;
280 SkXfermode::Coeff srcCoeff; 280 SkXfermode::Coeff srcCoeff;
281 SkAssertResult(SkXfermode::ModeAsCoeff(fMode, &srcCoeff, &dstCoeff)); 281 SkAssertResult(SkXfermode::ModeAsCoeff(fMode, &srcCoeff, &dstCoeff));
282 // These could be calculated from the blend equation with template trick ery.. 282 // These could be calculated from the blend equation with template trick ery..
283 if (SkXfermode::kZero_Coeff == dstCoeff && 283 if (SkXfermode::kZero_Coeff == dstCoeff &&
284 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { 284 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) {
285 this->setWillNotUseInputColor(); 285 this->setWillNotUseInputColor();
286 } 286 }
287 } 287 }
288 288
289 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 289 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE {
290 const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>(); 290 const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>();
291 return fMode == s.fMode && fColor == s.fColor; 291 return fMode == s.fMode && fColor == s.fColor;
292 } 292 }
293 293
294 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE; 294 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE;
295 295
296 SkXfermode::Mode fMode; 296 SkXfermode::Mode fMode;
297 GrColor fColor; 297 GrColor fColor;
298 298
299 typedef GrFragmentProcessor INHERITED; 299 typedef GrFragmentProcessor INHERITED;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), 550 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)),
551 SkIntToScalar(SkColorGetG(add)), 551 SkIntToScalar(SkColorGetG(add)),
552 SkIntToScalar(SkColorGetB(add)), 552 SkIntToScalar(SkColorGetB(add)),
553 0); 553 0);
554 return SkColorMatrixFilter::Create(matrix); 554 return SkColorMatrixFilter::Create(matrix);
555 } 555 }
556 556
557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) 557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter)
558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) 558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter)
559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698