From 58f9ae1c7aa6e0a04c48ae907ad78f849ae14836 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 23 Jan 2013 19:09:06 +0000 Subject: Revert 7342 to investigate failures. git-svn-id: http://skia.googlecode.com/svn/trunk@7345 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/GrEffectStage.h | 58 +-------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) (limited to 'include/gpu/GrEffectStage.h') diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h index b561aaac25..c09cd450a7 100644 --- a/include/gpu/GrEffectStage.h +++ b/include/gpu/GrEffectStage.h @@ -20,6 +20,7 @@ class GrEffectStage { public: + GrEffectStage() : fEffectRef (NULL) { GR_DEBUGCODE(fSavedCoordChangeCnt = 0;) @@ -94,63 +95,6 @@ public: GR_DEBUGCODE(savedCoordChange.fEffectRef.reset(NULL);) } - /** - * 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;) - } - - void saveFrom(const GrEffectStage& stage) { - GrAssert(!fInitialized); - if (NULL != stage.fEffectRef) { - stage.fEffectRef->get()->addRef(); - fEffect = stage.fEffectRef->get(); - fCoordChangeMatrix = stage.fCoordChangeMatrix; - } - SkDEBUGCODE(fInitialized = true;) - } - - void restoreTo(GrEffectStage* stage) { - GrAssert(fInitialized); - const GrEffectRef* oldEffectRef = stage->fEffectRef; - if (NULL != fEffect) { - stage->fEffectRef = GrEffect::CreateEffectRef(fEffect); - stage->fCoordChangeMatrix = fCoordChangeMatrix; - } else { - stage->fEffectRef = NULL; - } - SkSafeUnref(oldEffectRef); - } - - bool isEqual(const GrEffectStage& stage) const { - if (NULL == stage.fEffectRef) { - return NULL == fEffect; - } else if (NULL == fEffect) { - return false; - } - - if (!(*stage.getEffect())->isEqual(*fEffect)) { - return false; - } - - return fCoordChangeMatrix == stage.fCoordChangeMatrix; - } - - ~DeferredStage() { - if (NULL != fEffect) { - fEffect->subRef(); - } - } - private: - const GrEffect* fEffect; - SkMatrix fCoordChangeMatrix; - SkDEBUGCODE(bool fInitialized;) - }; - /** * Gets the matrix representing all changes of coordinate system since the GrEffect was * installed in the stage. -- cgit v1.2.3