Index: src/gpu/gl/GrGLBufferImpl.cpp |
diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp |
index 5d5ca88b2df920f01524ebdbe11be3312448b383..0e2990e7f9fcf1a802cd45e8da659a66d705bad0 100644 |
--- a/src/gpu/gl/GrGLBufferImpl.cpp |
+++ b/src/gpu/gl/GrGLBufferImpl.cpp |
@@ -25,7 +25,11 @@ GrGLBufferImpl::GrGLBufferImpl(GrGLGpu* gpu, const Desc& desc, GrGLenum bufferTy |
, fBufferType(bufferType) |
, fMapPtr(NULL) { |
if (0 == desc.fID) { |
- fCPUData = sk_malloc_flags(desc.fSizeInBytes, SK_MALLOC_THROW); |
+ if (gpu->caps()->mustClearUploadedBufferData()) { |
+ fCPUData = sk_calloc_throw(desc.fSizeInBytes); |
+ } else { |
+ fCPUData = sk_malloc_flags(desc.fSizeInBytes, SK_MALLOC_THROW); |
+ } |
fGLSizeInBytes = 0; |
} else { |
fCPUData = NULL; |