Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 1840663002: Temporary fix for --preAbandonGpuContext bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Temporary fix for --preAbandonGpuContext bug Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 SkIRect srcBounds = bounds; 544 SkIRect srcBounds = bounds;
545 srcBounds.offset(-inputOffset); 545 srcBounds.offset(-inputOffset);
546 546
547 if (0 == width && 0 == height) { 547 if (0 == width && 0 == height) {
548 offset->fX = bounds.left(); 548 offset->fX = bounds.left();
549 offset->fY = bounds.top(); 549 offset->fY = bounds.top();
550 return input->makeSubset(srcBounds); 550 return input->makeSubset(srcBounds);
551 } 551 }
552 552
553 #if SK_SUPPORT_GPU 553 #if SK_SUPPORT_GPU
554 if (input->peekTexture()) { 554 if (input->peekTexture() && input->peekTexture()->getContext()) {
555 auto type = dilate ? GrMorphologyEffect::kDilate_MorphologyType 555 auto type = dilate ? GrMorphologyEffect::kDilate_MorphologyType
556 : GrMorphologyEffect::kErode_MorphologyType; 556 : GrMorphologyEffect::kErode_MorphologyType;
557 sk_sp<SkSpecialImage> result(apply_morphology(input.get(), srcBounds, ty pe, 557 sk_sp<SkSpecialImage> result(apply_morphology(input.get(), srcBounds, ty pe,
558 SkISize::Make(width, heigh t))); 558 SkISize::Make(width, heigh t)));
559 if (result) { 559 if (result) {
560 offset->fX = bounds.left(); 560 offset->fX = bounds.left();
561 offset->fY = bounds.top(); 561 offset->fY = bounds.top();
562 } 562 }
563 return result; 563 return result;
564 } 564 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 sk_sp<SkSpecialImage> SkDilateImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx, 626 sk_sp<SkSpecialImage> SkDilateImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
627 SkIPoint* offset) const { 627 SkIPoint* offset) const {
628 return this->filterImageGeneric(true, source, ctx, offset); 628 return this->filterImageGeneric(true, source, ctx, offset);
629 } 629 }
630 630
631 sk_sp<SkSpecialImage> SkErodeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx, 631 sk_sp<SkSpecialImage> SkErodeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
632 SkIPoint* offset) const { 632 SkIPoint* offset) const {
633 return this->filterImageGeneric(false, source, ctx, offset); 633 return this->filterImageGeneric(false, source, ctx, offset);
634 } 634 }
635 635
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698