small fix for cache clear

BUG=skia:

Review URL: https://codereview.chromium.org/695873002
This commit is contained in:
joshualitt 2014-10-31 08:27:39 -07:00 committed by Commit bot
parent c17c6582ec
commit 3bdd7dce5e
3 changed files with 10 additions and 16 deletions

View File

@ -80,12 +80,6 @@ public:
return kAlpha_ClipMaskType == fCurrClipMaskType;
}
void invalidateStencilMask() {
if (kStencil_ClipMaskType == fCurrClipMaskType) {
fCurrClipMaskType = kNone_ClipMaskType;
}
}
GrContext* getContext() {
return fAACache.getContext();
}

View File

@ -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;

View File

@ -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;