Index: src/gpu/gl/GrGpuGL.cpp |
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
index ed8279d865a27424a4ea5a810a5cbd79e61feb2f..bd48033c8a86b4ddb0ce2c2e9743a986c7fec8d0 100644 |
--- a/src/gpu/gl/GrGpuGL.cpp |
+++ b/src/gpu/gl/GrGpuGL.cpp |
@@ -578,7 +578,11 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc, |
size_t trimRowBytes = width * bpp; |
// in case we need a temporary, trimmed copy of the src pixels |
+#if GR_ALWAYS_ALLOCATE_ON_HEAP |
+ SkAutoMalloc tempStorage; |
+#else |
SkAutoSMalloc<128 * 128> tempStorage; |
+#endif |
// We currently lazily create MIPMAPs when the we see a draw with |
// GrTextureParams::kMipMap_FilterMode. Using texture storage requires that the |
@@ -1666,7 +1670,13 @@ bool GrGpuGL::onReadPixels(GrRenderTarget* target, |
// determine if GL can read using the passed rowBytes or if we need |
// a scratch buffer. |
+ |
+#if GR_ALWAYS_ALLOCATE_ON_HEAP |
+ SkAutoMalloc scratch; |
+#else |
SkAutoSMalloc<32 * sizeof(GrColor)> scratch; |
+#endif |
+ |
if (rowBytes != tightRowBytes) { |
if (this->glCaps().packRowLengthSupport()) { |
SkASSERT(!(rowBytes % sizeof(GrColor))); |