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

Unified Diff: src/gpu/GrContext.cpp

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
Index: src/gpu/GrContext.cpp
===================================================================
--- src/gpu/GrContext.cpp (revision 10125)
+++ src/gpu/GrContext.cpp (working copy)
@@ -66,9 +66,11 @@
// Glorified typedef to avoid including GrDrawState.h in GrContext.h
class GrContext::AutoRestoreEffects : public GrDrawState::AutoRestoreEffects {};
-GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) {
+GrContext* GrContext::Create(GrBackend backend,
+ GrBackendContext backendContext,
+ bool* reuseScratchTextures) {
GrContext* context = SkNEW(GrContext);
- if (context->init(backend, backendContext)) {
+ if (context->init(backend, backendContext, reuseScratchTextures)) {
return context;
} else {
context->unref();
@@ -104,7 +106,9 @@
fViewMatrix.reset();
}
-bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
+bool GrContext::init(GrBackend backend,
+ GrBackendContext backendContext,
+ bool* reuseScratchTextures) {
GrAssert(NULL == fGpu);
fGpu = GrGpu::Create(backend, backendContext, this);
@@ -115,6 +119,11 @@
fDrawState = SkNEW(GrDrawState);
fGpu->setDrawState(fDrawState);
+ if (NULL == reuseScratchTextures) {
+ this->setReuseScratchTextures(fGpu->caps()->reuseScratchTextures());
+ } else {
+ this->setReuseScratchTextures(*reuseScratchTextures);
+ }
fTextureCache = SkNEW_ARGS(GrResourceCache,
(MAX_TEXTURE_CACHE_COUNT,
« include/gpu/GrContext.h ('K') | « include/gpu/GrContext.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698