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

Unified Diff: src/gpu/GrDrawState.h

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 6440790c10b1d611e651ea786f97a4b0a008d79e..6dcb2dc487ce08b6fe96acfb1d018f753c1238f3 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -266,18 +266,6 @@ public:
}
/**
- * Add a color filter that can be represented by a color and a mode. Applied
- * after color-computing effect stages.
- */
- void setColorFilter(GrColor c, SkXfermode::Mode mode) {
- fCommon.fColorFilterColor = c;
- fCommon.fColorFilterMode = mode;
- }
-
- GrColor getColorFilterColor() const { return fCommon.fColorFilterColor; }
- SkXfermode::Mode getColorFilterMode() const { return fCommon.fColorFilterMode; }
-
- /**
* Constructor sets the color to be 'color' which is undone by the destructor.
*/
class AutoColorRestore : public ::SkNoncopyable {
@@ -360,6 +348,9 @@ public:
const GrEffectRef* addColorEffect(const GrEffectRef* effect, int attr0 = -1, int attr1 = -1) {
SkASSERT(NULL != effect);
+ if (!(*effect)->willUseInputColor()) {
bsalomon 2013/10/02 16:37:59 I don't think this is safe because of AutoRestoreE
Kimmo Kinnunen 2013/10/04 06:21:18 Done. Not sure the new naming is the best possible
+ fColorStages.reset();
+ }
SkNEW_APPEND_TO_TARRAY(&fColorStages, GrEffectStage, (effect, attr0, attr1));
return effect;
}
@@ -915,8 +906,6 @@ private:
fCommon.fFlagBits = 0x0;
fCommon.fStencilSettings.setDisabled();
fCommon.fCoverage = 0xffffffff;
- fCommon.fColorFilterMode = SkXfermode::kDst_Mode;
- fCommon.fColorFilterColor = 0x0;
fCommon.fDrawFace = kBoth_DrawFace;
}
@@ -933,8 +922,6 @@ private:
int fVACount;
GrStencilSettings fStencilSettings;
GrColor fCoverage;
- SkXfermode::Mode fColorFilterMode;
- GrColor fColorFilterColor;
DrawFace fDrawFace;
// This is simply a different representation of info in fVertexAttribs and thus does
@@ -952,8 +939,6 @@ private:
!memcmp(fVAPtr, other.fVAPtr, fVACount * sizeof(GrVertexAttrib)) &&
fStencilSettings == other.fStencilSettings &&
fCoverage == other.fCoverage &&
- fColorFilterMode == other.fColorFilterMode &&
- fColorFilterColor == other.fColorFilterColor &&
fDrawFace == other.fDrawFace;
SkASSERT(!result || 0 == memcmp(fFixedFunctionVertexAttribIndices,
other.fFixedFunctionVertexAttribIndices,

Powered by Google App Engine
This is Rietveld 408576698