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

Side by Side Diff: src/core/SkXfermode.cpp

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix isSolidWhite 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 | « include/gpu/GrProcessor.h ('k') | src/effects/SkAlphaThresholdFilter.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkXfermode.h" 10 #include "SkXfermode.h"
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 792 }
793 793
794 static GrFragmentProcessor* Create(SkXfermode::Mode mode, GrTexture* backgro und) { 794 static GrFragmentProcessor* Create(SkXfermode::Mode mode, GrTexture* backgro und) {
795 if (!IsSupportedMode(mode)) { 795 if (!IsSupportedMode(mode)) {
796 return NULL; 796 return NULL;
797 } else { 797 } else {
798 return SkNEW_ARGS(XferEffect, (mode, background)); 798 return SkNEW_ARGS(XferEffect, (mode, background));
799 } 799 }
800 } 800 }
801 801
802 virtual void getConstantColorComponents(GrColor* color,
803 uint32_t* validFlags) const SK_OVERR IDE {
804 *validFlags = 0;
805 }
806
807 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE { 802 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR IDE {
808 return GrTBackendFragmentProcessorFactory<XferEffect>::getInstance(); 803 return GrTBackendFragmentProcessorFactory<XferEffect>::getInstance();
809 } 804 }
810 805
811 static const char* Name() { return "XferEffect"; } 806 static const char* Name() { return "XferEffect"; }
812 807
813 SkXfermode::Mode mode() const { return fMode; } 808 SkXfermode::Mode mode() const { return fMode; }
814 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; } 809 const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; }
815 810
816 class GLProcessor : public GrGLFragmentProcessor { 811 class GLProcessor : public GrGLFragmentProcessor {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 this->addTextureAccess(&fBackgroundAccess); 1204 this->addTextureAccess(&fBackgroundAccess);
1210 } else { 1205 } else {
1211 this->setWillReadDstColor(); 1206 this->setWillReadDstColor();
1212 } 1207 }
1213 } 1208 }
1214 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 1209 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
1215 const XferEffect& s = other.cast<XferEffect>(); 1210 const XferEffect& s = other.cast<XferEffect>();
1216 return fMode == s.fMode && 1211 return fMode == s.fMode &&
1217 fBackgroundAccess.getTexture() == s.fBackgroundAccess.getTexture( ); 1212 fBackgroundAccess.getTexture() == s.fBackgroundAccess.getTexture( );
1218 } 1213 }
1214
1215 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
1216 inout->fValidFlags = 0;
1217 inout->fIsSingleComponent = false;
1218 }
1219 1219
1220 SkXfermode::Mode fMode; 1220 SkXfermode::Mode fMode;
1221 GrCoordTransform fBackgroundTransform; 1221 GrCoordTransform fBackgroundTransform;
1222 GrTextureAccess fBackgroundAccess; 1222 GrTextureAccess fBackgroundAccess;
1223 1223
1224 typedef GrFragmentProcessor INHERITED; 1224 typedef GrFragmentProcessor INHERITED;
1225 }; 1225 };
1226 1226
1227 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(XferEffect); 1227 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(XferEffect);
1228 GrFragmentProcessor* XferEffect::TestCreate(SkRandom* rand, 1228 GrFragmentProcessor* XferEffect::TestCreate(SkRandom* rand,
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 } else { 1955 } else {
1956 proc16 = rec.fProc16_General; 1956 proc16 = rec.fProc16_General;
1957 } 1957 }
1958 } 1958 }
1959 return proc16; 1959 return proc16;
1960 } 1960 }
1961 1961
1962 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1962 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1963 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1963 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1964 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1964 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « include/gpu/GrProcessor.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698