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

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

Issue 1393283008: Image filters: refactor input GPU processing into filterInputGPU(). (Closed) Base URL: https://skia.googlesource.com/skia.git@filter-input
Patch Set: Update to ToT Created 5 years, 2 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/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.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 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 }; 605 };
606 606
607 bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate, 607 bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
608 Proxy* proxy, 608 Proxy* proxy,
609 const SkBitmap& src, 609 const SkBitmap& src,
610 const Context& ctx, 610 const Context& ctx,
611 SkBitmap* result, 611 SkBitmap* result,
612 SkIPoint* offset) const { 612 SkIPoint* offset) const {
613 SkBitmap input = src; 613 SkBitmap input = src;
614 SkIPoint srcOffset = SkIPoint::Make(0, 0); 614 SkIPoint srcOffset = SkIPoint::Make(0, 0);
615 if (this->getInput(0) && 615 if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) {
616 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffse t)) {
617 return false; 616 return false;
618 } 617 }
619 SkIRect bounds; 618 SkIRect bounds;
620 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) { 619 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) {
621 return false; 620 return false;
622 } 621 }
623 SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()), 622 SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()),
624 SkIntToScalar(this->radius().height())); 623 SkIntToScalar(this->radius().height()));
625 ctx.ctm().mapVectors(&radius, 1); 624 ctx.ctm().mapVectors(&radius, 1);
626 int width = SkScalarFloorToInt(radius.fX); 625 int width = SkScalarFloorToInt(radius.fX);
(...skipping 26 matching lines...) Expand all
653 SkBitmap* result, SkIPoint* offset) con st { 652 SkBitmap* result, SkIPoint* offset) con st {
654 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); 653 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset);
655 } 654 }
656 655
657 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx, 656 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
658 SkBitmap* result, SkIPoint* offset) cons t { 657 SkBitmap* result, SkIPoint* offset) cons t {
659 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); 658 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset);
660 } 659 }
661 660
662 #endif 661 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698