Add GrContext::setMaxTextureSizeOverride

https://codereview.chromium.org/20325002/



git-svn-id: http://skia.googlecode.com/svn/trunk@10358 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 6eae95e..3951d91 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -102,6 +102,7 @@
     fAARectRenderer = NULL;
     fOvalRenderer = NULL;
     fViewMatrix.reset();
+    fMaxTextureSizeOverride = 1 << 20;
 }
 
 bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
@@ -554,7 +555,7 @@
 }
 
 int GrContext::getMaxTextureSize() const {
-    return fGpu->caps()->maxTextureSize();
+    return GrMin(fGpu->caps()->maxTextureSize(), fMaxTextureSizeOverride);
 }
 
 int GrContext::getMaxRenderTargetSize() const {