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

Unified Diff: src/effects/SkComposeImageFilter.cpp

Issue 1768283002: Switch SkComposeImageFilter over to new onFilterImage interface (Closed) Base URL: https://skia.googlesource.com/skia.git@if-follow-on
Patch Set: Update for naming convention Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/effects/SkComposeImageFilter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkComposeImageFilter.cpp
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp
index 2ec7683e9be269b2cf4b318e156f1cee7c1e2321..90844ef9dca23b35189c928846ac7372e945b48b 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -5,13 +5,12 @@
* found in the LICENSE file.
*/
-#include "SkBitmap.h"
#include "SkComposeImageFilter.h"
+
#include "SkReadBuffer.h"
+#include "SkSpecialImage.h"
#include "SkWriteBuffer.h"
-SkComposeImageFilter::~SkComposeImageFilter() {
-}
void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
SkImageFilter* outer = getInput(0);
@@ -22,36 +21,36 @@ void SkComposeImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) con
outer->computeFastBounds(tmp, dst);
}
-bool SkComposeImageFilter::onFilterImageDeprecated(Proxy* proxy,
- const SkBitmap& src,
- const Context& ctx,
- SkBitmap* result,
- SkIPoint* offset) const {
- SkBitmap tmp;
+SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
+ SkIPoint* offset) const {
SkIPoint innerOffset = SkIPoint::Make(0, 0);
- SkIPoint outerOffset = SkIPoint::Make(0, 0);
- if (!this->filterInputDeprecated(1, proxy, src, ctx, &tmp, &innerOffset))
- return false;
+ SkAutoTUnref<SkSpecialImage> inner(this->filterInput(1, source, ctx, &innerOffset));
+ if (!inner) {
+ return nullptr;
+ }
SkMatrix outerMatrix(ctx.ctm());
outerMatrix.postTranslate(SkIntToScalar(-innerOffset.x()), SkIntToScalar(-innerOffset.y()));
SkIRect clipBounds = ctx.clipBounds();
clipBounds.offset(-innerOffset.x(), -innerOffset.y());
Context outerContext(outerMatrix, clipBounds, ctx.cache());
- if (!this->filterInputDeprecated(0, proxy, tmp, outerContext, result, &outerOffset)) {
- return false;
+
+ SkIPoint outerOffset = SkIPoint::Make(0, 0);
+ SkAutoTUnref<SkSpecialImage> outer(this->filterInput(0, inner, outerContext, &outerOffset));
+ if (!outer) {
+ return nullptr;
}
*offset = innerOffset + outerOffset;
- return true;
+ return outer.release();
}
bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
const SkMatrix& ctm,
SkIRect* dst,
MapDirection direction) const {
- SkImageFilter* outer = getInput(0);
- SkImageFilter* inner = getInput(1);
+ SkImageFilter* outer = this->getInput(0);
+ SkImageFilter* inner = this->getInput(1);
SkIRect tmp;
return inner->filterBounds(src, ctm, &tmp, direction) &&
« no previous file with comments | « include/effects/SkComposeImageFilter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698