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:
parent
706f6212c6
commit
ff17584e1c
@ -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
|
||||
|
@ -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() {};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user