Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: include/gpu/GrContext.h

Issue 19636002: Plumb in flag for reusing scratch textures (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698