Attached ClipMaskManager to GPU resource freeing system

http://codereview.appspot.com/6208058/



git-svn-id: http://skia.googlecode.com/svn/trunk@3927 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-05-14 19:31:39 +00:00
parent 706f6212c6
commit ff17584e1c
3 changed files with 15 additions and 0 deletions

View File

@ -110,6 +110,9 @@ void GrContext::resetContext() {
void GrContext::freeGpuResources() {
this->flush();
fGpu->purgeResources();
fTextureCache->removeAll();
fFontCache->freeAll();
// a path renderer may be holding onto resources

View File

@ -545,6 +545,12 @@ public:
*/
virtual void clear(const GrIRect* rect, GrColor color) = 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() {};
////////////////////////////////////////////////////////////////////////////
/**

View File

@ -318,6 +318,12 @@ public:
// GrDrawTarget overrides
virtual void clear(const GrIRect* rect, GrColor color);
virtual void purgeResources() SK_OVERRIDE {
// The clip mask manager can rebuild all its clip masks so just
// get rid of them all.
fClipMaskManager.releaseResources();
}
// 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.