diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h index c38e1405b0..20b7fdc077 100644 --- a/src/gpu/GrClipMaskManager.h +++ b/src/gpu/GrClipMaskManager.h @@ -80,12 +80,6 @@ public: return kAlpha_ClipMaskType == fCurrClipMaskType; } - void invalidateStencilMask() { - if (kStencil_ClipMaskType == fCurrClipMaskType) { - fCurrClipMaskType = kNone_ClipMaskType; - } - } - GrContext* getContext() { return fAACache.getContext(); } diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index 1f26166f6e..7d8a03ce71 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -968,6 +968,16 @@ public: */ virtual void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* = NULL) = 0; + /** + * Release any resources that are cached but not currently in use. This + * is intended to give an application some recourse when resources are low. + */ + virtual void purgeResources() SK_OVERRIDE { + // The clip mask manager can rebuild all its clip masks so just + // get rid of them all. + fClipMaskManager.purgeResources(); + }; + protected: GrClipMaskManager fClipMaskManager; diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 62abd825d3..7c90ee4702 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -275,12 +275,6 @@ public: bool insideClip, GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; - virtual void purgeResources() SK_OVERRIDE { - // The clip mask manager can rebuild all its clip masks so just - // get rid of them all. - fClipMaskManager.purgeResources(); - } - // After the client interacts directly with the 3D context state the GrGpu // must resync its internal state and assumptions about 3D context state. // Each time this occurs the GrGpu bumps a timestamp. @@ -471,10 +465,6 @@ private: void prepareIndexPool(); void resetContext() { - // We call this because the client may have messed with the - // stencil buffer. Perhaps we should detect whether it is a - // internally created stencil buffer and if so skip the invalidate. - fClipMaskManager.invalidateStencilMask(); this->onResetContext(fResetBits); fResetBits = 0; ++fResetTimestamp;