aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-28 11:07:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-28 11:07:43 -0700
commit090b7629daa4d2ed13424d21e93f0ff0c4886ba9 (patch)
tree9f9f005983b866fcbf1e641aebedebded76557ce /src/effects
parentdfed06f6ff5a8e71a48a955f49deac3afd646952 (diff)
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
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkBlurImageFilter.cpp2
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index 692b6c9b80..60d8d17cdf 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -94,7 +94,7 @@ sk_sp<SkSpecialImage> SkBlurImageFilter::onFilterImage(SkSpecialImage* source,
const SkVector sigma = map_sigma(fSigma, ctx.ctm());
#if SK_SUPPORT_GPU
- if (input->peekTexture()) {
+ if (input->peekTexture() && input->peekTexture()->getContext()) {
if (0 == sigma.x() && 0 == sigma.y()) {
offset->fX = inputBounds.x();
offset->fY = inputBounds.y();
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<SkSpecialImage> 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<SkSpecialImage> result(apply_morphology(input.get(), srcBounds, type,