diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-19 12:56:26 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-19 12:56:26 +0000 |
commit | 7d1267539f952e1a53fdb3257eea97e6737c8a84 (patch) | |
tree | d3eff91b44fb1bb3ecc57ff0da4b5566ee190fe7 | |
parent | 6a748ad8d82576c4ce59e9b2409d41a93bf05cdf (diff) |
GPU: add failure checks for the scratch textures used in Gaussian blur.
https://codereview.appspot.com/6744047/
On behalf of senorblanco
git-svn-id: http://skia.googlecode.com/svn/trunk@6014 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/GrContext.cpp | 3 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 63e5c2c1fc..1ea2906410 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1804,6 +1804,9 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, GrAutoScratchTexture temp1, temp2; GrTexture* dstTexture = temp1.set(this, desc); GrTexture* tempTexture = canClobberSrc ? srcTexture : temp2.set(this, desc); + if (NULL == dstTexture || NULL == tempTexture) { + return NULL; + } GrPaint paint; paint.reset(); diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 5506d1ab99..dadb9a0584 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -859,6 +859,9 @@ bool drawWithGPUMaskFilter(GrContext* context, const SkPath& devPath, bool isNormalBlur = blurType == SkMaskFilter::kNormal_BlurType; blurTexture.reset(context->gaussianBlur(pathTexture, isNormalBlur, srcRect, sigma, sigma)); + if (NULL == blurTexture) { + return false; + } if (!isNormalBlur) { context->setIdentityMatrix(); |