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

Unified Diff: include/gpu/GrEffectStage.h

Issue 373603005: Remove GrEffectStage::DeferredStage (Closed) Base URL: https://skia.googlesource.com/skia.git@no_common
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffectStage.h
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 8b6cb11dfc6b9f489c47175c31107455eec98b05..478ea5e4c45c2c941a7d4b517df0c26933d00ced 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -31,12 +31,6 @@ public:
*this = other;
}
- class DeferredStage;
- // This constructor balances DeferredStage::saveFrom().
- explicit GrEffectStage(const DeferredStage& deferredStage) {
- deferredStage.restoreTo(this);
- }
-
GrEffectStage& operator= (const GrEffectStage& other) {
fCoordChangeMatrixSet = other.fCoordChangeMatrixSet;
if (other.fCoordChangeMatrixSet) {
@@ -121,82 +115,6 @@ public:
}
/**
- * Used when storing a deferred GrDrawState. The DeferredStage allows resources owned by its
- * GrEffect to be recycled through the cache.
- */
- class DeferredStage {
- public:
- DeferredStage() : fEffect(NULL) {
- SkDEBUGCODE(fInitialized = false;)
- }
-
- ~DeferredStage() {
- if (NULL != fEffect) {
- fEffect->decDeferredRefCounts();
- }
- }
-
- void saveFrom(const GrEffectStage& stage) {
- SkASSERT(!fInitialized);
- SkASSERT(NULL != stage.fEffectRef.get());
- stage.fEffectRef->get()->incDeferredRefCounts();
- fEffect = stage.fEffectRef->get();
- fCoordChangeMatrixSet = stage.fCoordChangeMatrixSet;
- if (fCoordChangeMatrixSet) {
- fCoordChangeMatrix = stage.fCoordChangeMatrix;
- }
- fVertexAttribIndices[0] = stage.fVertexAttribIndices[0];
- fVertexAttribIndices[1] = stage.fVertexAttribIndices[1];
- SkDEBUGCODE(fInitialized = true;)
- }
-
- void restoreTo(GrEffectStage* stage) const {
- SkASSERT(fInitialized);
- stage->fEffectRef.reset(GrEffect::CreateEffectRef(fEffect));
- stage->fCoordChangeMatrixSet = fCoordChangeMatrixSet;
- if (fCoordChangeMatrixSet) {
- stage->fCoordChangeMatrix = fCoordChangeMatrix;
- }
- stage->fVertexAttribIndices[0] = fVertexAttribIndices[0];
- stage->fVertexAttribIndices[1] = fVertexAttribIndices[1];
- }
-
- bool isEqual(const GrEffectStage& stage, bool ignoreCoordChange) const {
- if (fVertexAttribIndices[0] != stage.fVertexAttribIndices[0] ||
- fVertexAttribIndices[1] != stage.fVertexAttribIndices[1]) {
- return false;
- }
-
- if (!(*stage.getEffect())->isEqual(*fEffect)) {
- return false;
- }
-
- if (ignoreCoordChange) {
- // ignore the coordinate change matrix since there are
- // explicit uv coordinates
- return true;
- }
-
- if (fCoordChangeMatrixSet != stage.fCoordChangeMatrixSet) {
- return false;
- }
-
- if (!fCoordChangeMatrixSet) {
- return true;
- }
-
- return fCoordChangeMatrix == stage.fCoordChangeMatrix;
- }
-
- private:
- const GrEffect* fEffect;
- bool fCoordChangeMatrixSet;
- SkMatrix fCoordChangeMatrix;
- int fVertexAttribIndices[2];
- SkDEBUGCODE(bool fInitialized;)
- };
-
- /**
* Gets the matrix representing all changes of coordinate system since the GrEffect was
* installed in the stage.
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698