From 41511604ae0aadddef0c4defeb73dcbe4408ff66 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 2 Feb 2017 10:06:18 -0500 Subject: [PATCH] Force instantiation in GaussianBlur to hopefully prevent (and diagnose) Chrome crash BUG=687174 Change-Id: Ieb9930feca9abad9220a1a099e7dd247e6eff70e Reviewed-on: https://skia-review.googlesource.com/7920 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/core/SkGpuBlurUtils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp index c14a55c111..c052c50dcb 100644 --- a/src/core/SkGpuBlurUtils.cpp +++ b/src/core/SkGpuBlurUtils.cpp @@ -194,6 +194,17 @@ sk_sp GaussianBlur(GrContext* context, float sigmaY, SkBackingFit fit) { SkASSERT(context); + + { + // Chrome is crashing with proxies when they need to be instantiated. + // Force an instantiation here (where, in olden days, we used to require a GrTexture) + // to see if the input is already un-instantiable. + GrTexture* temp = srcProxy->instantiate(context->textureProvider()); + if (!temp) { + return nullptr; + } + } + SkIRect clearRect; int scaleFactorX, radiusX; int scaleFactorY, radiusY;