From 090b7629daa4d2ed13424d21e93f0ff0c4886ba9 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Mon, 28 Mar 2016 11:07:43 -0700 Subject: Temporary fix for --preAbandonGpuContext bug In this instance what is going wrong is: the context gets abandoned SkCanvas tries to create a new SkGpuDevice (which fails) if then creates a bitmap device it then attempts to draw the abandoned GrTexture (behind the old SkGpuDevice into the new bitmap device with an image filter b.c. some image filters still switch their behavior based on the presence of a texture bad stuff happens This used to be resolved by the new bitmap device getting forced down the bitmap path and then failing when it attempted to readback the GrTexture. BUG=skia:5138 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840663002 Review URL: https://codereview.chromium.org/1840663002 --- src/effects/SkMorphologyImageFilter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/effects/SkMorphologyImageFilter.cpp') diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 6abd1fc236..b592fd01b0 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -551,7 +551,7 @@ sk_sp SkMorphologyImageFilter::filterImageGeneric(bool dilate, } #if SK_SUPPORT_GPU - if (input->peekTexture()) { + if (input->peekTexture() && input->peekTexture()->getContext()) { auto type = dilate ? GrMorphologyEffect::kDilate_MorphologyType : GrMorphologyEffect::kErode_MorphologyType; sk_sp result(apply_morphology(input.get(), srcBounds, type, -- cgit v1.2.3