Index: include/gpu/GrContext.h |
=================================================================== |
--- include/gpu/GrContext.h (revision 10125) |
+++ include/gpu/GrContext.h (working copy) |
@@ -47,7 +47,7 @@ |
/** |
* Creates a GrContext for a backend context. |
*/ |
robertphillips
2013/07/17 16:51:32
An option would be to pass in a tri-value enum (e.
|
- static GrContext* Create(GrBackend, GrBackendContext); |
+ static GrContext* Create(GrBackend, GrBackendContext, bool* reuseScratchTextures = NULL); |
/** |
* Returns the number of GrContext instances for the current thread. |
@@ -85,6 +85,15 @@ |
} |
/** |
+ * Change the context's scratch texture reuse behavior. On some platforms |
+ * reusing scratch textures can cause the driver to ghost the texture |
+ * which, in excess, can lead to out of memory problems |
+ */ |
robertphillips
2013/07/17 16:51:32
This would remain a bool
|
+ void setReuseScratchTextures(bool reuseScratchTextures) { |
+ fReuseScratchTextures = reuseScratchTextures; |
+ } |
+ |
+ /** |
* Abandons all GPU resources, assumes 3D API state is unknown. Call this |
* if you have lost the associated GPU context, and thus internal texture, |
* buffer, etc. references/IDs are now invalid. Should be called even when |
@@ -867,6 +876,8 @@ |
int fPMToUPMConversion; |
int fUPMToPMConversion; |
robertphillips
2013/07/17 16:51:32
This would remain a bool
|
+ bool fReuseScratchTextures; |
+ |
struct CleanUpData { |
PFCleanUpFunc fFunc; |
void* fInfo; |
@@ -875,7 +886,7 @@ |
SkTDArray<CleanUpData> fCleanUpData; |
GrContext(); // init must be called after the constructor. |
robertphillips
2013/07/17 16:51:32
This would also become tri-value
|
- bool init(GrBackend, GrBackendContext); |
+ bool init(GrBackend, GrBackendContext, bool *reuseScratchTextures); |
void setupDrawBuffer(); |