OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |