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

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

Issue 1612953004: Image filters: Make a recursive, forward-mapping bounds traversal. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 11 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/SkMergeImageFilter.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkTileImageFilter.h" 8 #include "SkTileImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 void SkTileImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& c tm, 111 void SkTileImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& c tm,
112 SkIRect* dst, MapDirection direction) const { 112 SkIRect* dst, MapDirection direction) const {
113 SkRect rect = kReverse_MapDirection == direction ? fSrcRect : fDstRect; 113 SkRect rect = kReverse_MapDirection == direction ? fSrcRect : fDstRect;
114 ctm.mapRect(&rect); 114 ctm.mapRect(&rect);
115 rect.roundOut(dst); 115 rect.roundOut(dst);
116 } 116 }
117 117
118 bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, 118 bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
119 SkIRect* dst) const { 119 SkIRect* dst, MapDirection direction) con st {
120 this->onFilterNodeBounds(src, ctm, dst, kReverse_MapDirection); 120 // Don't recurse into inputs.
121 *dst = src;
121 return true; 122 return true;
122 } 123 }
123 124
124 void SkTileImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { 125 void SkTileImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
125 *dst = fDstRect; 126 *dst = fDstRect;
126 } 127 }
127 128
128 SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { 129 SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) {
129 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 130 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
130 SkRect src, dst; 131 SkRect src, dst;
(...skipping 16 matching lines...) Expand all
147 str->appendf(" dst: %.2f %.2f %.2f %.2f", 148 str->appendf(" dst: %.2f %.2f %.2f %.2f",
148 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m); 149 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m);
149 if (this->getInput(0)) { 150 if (this->getInput(0)) {
150 str->appendf("input: ("); 151 str->appendf("input: (");
151 this->getInput(0)->toString(str); 152 this->getInput(0)->toString(str);
152 str->appendf(")"); 153 str->appendf(")");
153 } 154 }
154 str->append(")"); 155 str->append(")");
155 } 156 }
156 #endif 157 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698