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

Unified Diff: src/gpu/GrDrawState.h

Issue 701123003: Remove cached OptDrawState from GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment Created 6 years, 1 month 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
« no previous file with comments | « no previous file | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 97516e80432190adc444b68cf306e55ae5a68933..15df975d73c4470d5c1e0b83a85ae77c96e4fe9a 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -28,12 +28,12 @@ class GrDrawState : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrDrawState)
- GrDrawState() : fCachedOptState(NULL) {
+ GrDrawState() {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
this->reset();
}
- GrDrawState(const SkMatrix& initialViewMatrix) : fCachedOptState(NULL) {
+ GrDrawState(const SkMatrix& initialViewMatrix) {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
this->reset(initialViewMatrix);
}
@@ -41,7 +41,7 @@ public:
/**
* Copies another draw state.
**/
- GrDrawState(const GrDrawState& state) : INHERITED(), fCachedOptState(NULL) {
+ GrDrawState(const GrDrawState& state) : INHERITED() {
SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
*this = state;
}
@@ -175,7 +175,6 @@ public:
void setColor(GrColor color) {
if (color != fColor) {
fColor = color;
- this->invalidateOptState();
}
}
@@ -207,7 +206,6 @@ public:
void setCoverage(uint8_t coverage) {
if (coverage != fCoverage) {
fCoverage = coverage;
- this->invalidateOptState();
}
}
@@ -223,7 +221,6 @@ public:
SkASSERT(geometryProcessor);
SkASSERT(!this->hasGeometryProcessor());
fGeometryProcessor.reset(SkRef(geometryProcessor));
- this->invalidateOptState();
return geometryProcessor;
}
@@ -267,14 +264,12 @@ public:
const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effect) {
SkASSERT(effect);
SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (effect));
- this->invalidateOptState();
return effect;
}
const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* effect) {
SkASSERT(effect);
SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (effect));
- this->invalidateOptState();
return effect;
}
@@ -415,7 +410,6 @@ public:
if (srcCoeff != fSrcBlend || dstCoeff != fDstBlend) {
fSrcBlend = srcCoeff;
fDstBlend = dstCoeff;
- this->invalidateOptState();
}
#ifdef SK_DEBUG
if (GrBlendCoeffRefsDst(dstCoeff)) {
@@ -440,7 +434,6 @@ public:
void setBlendConstant(GrColor constant) {
if (constant != fBlendConstant) {
fBlendConstant = constant;
- this->invalidateOptState();
}
}
@@ -539,7 +532,6 @@ public:
*/
void setRenderTarget(GrRenderTarget* target) {
fRenderTarget.set(SkSafeRef(target), kWrite_GrIOType);
- this->invalidateOptState();
}
/// @}
@@ -560,7 +552,6 @@ public:
void setStencil(const GrStencilSettings& settings) {
if (settings != fStencilSettings) {
fStencilSettings = settings;
- this->invalidateOptState();
}
}
@@ -570,7 +561,6 @@ public:
void disableStencil() {
if (!fStencilSettings.isDisabled()) {
fStencilSettings.setDisabled();
- this->invalidateOptState();
}
}
@@ -630,7 +620,6 @@ public:
void resetStateFlags() {
if (0 != fFlagBits) {
fFlagBits = 0;
- this->invalidateOptState();
}
}
@@ -642,7 +631,6 @@ public:
void enableState(uint32_t stateBits) {
if (stateBits & ~fFlagBits) {
fFlagBits |= stateBits;
- this->invalidateOptState();
}
}
@@ -654,7 +642,6 @@ public:
void disableState(uint32_t stateBits) {
if (stateBits & fFlagBits) {
fFlagBits &= ~(stateBits);
- this->invalidateOptState();
}
}
@@ -809,8 +796,6 @@ private:
*/
bool srcAlphaWillBeOne() const;
- void invalidateOptState() const;
-
void onReset(const SkMatrix* initialViewMatrix);
// Some of the auto restore objects assume that no effects are removed during their lifetime.
@@ -847,9 +832,6 @@ private:
// not need to be compared in op==.
int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt];
- mutable GrOptDrawState* fCachedOptState;
- mutable uint32_t fCachedCapsID;
-
friend class GrOptDrawState;
typedef SkRefCnt INHERITED;
« no previous file with comments | « no previous file | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698