aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-07-07 10:46:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-07 10:46:32 -0700
commit81d71885f13ba69afb414e600180b36354b923fd (patch)
treec250481dc051f93cdd7abedd6ec3a679b496f707 /include/gpu
parent7cdc1ee11545a10708e857adf1d4a94a2f1e2a48 (diff)
Remove GrEffectStage::DeferredStage
R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/373603005
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrEffectStage.h82
1 files changed, 0 insertions, 82 deletions
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 8b6cb11dfc..478ea5e4c4 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.
*/