OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkNWayCanvas.h" | 8 #include "SkNWayCanvas.h" |
9 | 9 |
10 SkNWayCanvas::SkNWayCanvas(int width, int height) | 10 SkNWayCanvas::SkNWayCanvas(int width, int height) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { | 166 void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { |
167 Iter iter(fList); | 167 Iter iter(fList); |
168 while (iter.next()) { | 168 while (iter.next()) { |
169 iter->drawRRect(rrect, paint); | 169 iter->drawRRect(rrect, paint); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, | 173 void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, cons
t SkPaint& paint) { |
174 const SkPaint& paint) { | |
175 Iter iter(fList); | 174 Iter iter(fList); |
176 while (iter.next()) { | 175 while (iter.next()) { |
177 iter->drawDRRect(outer, inner, paint); | 176 iter->drawDRRect(outer, inner, paint); |
178 } | 177 } |
179 } | 178 } |
180 | 179 |
181 void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { | 180 void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { |
182 Iter iter(fList); | 181 Iter iter(fList); |
183 while (iter.next()) { | 182 while (iter.next()) { |
184 iter->drawPath(path, paint); | 183 iter->drawPath(path, paint); |
185 } | 184 } |
186 } | 185 } |
187 | 186 |
188 void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, | 187 void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
189 const SkPaint* paint) { | 188 const SkPaint* paint) { |
190 Iter iter(fList); | 189 Iter iter(fList); |
191 while (iter.next()) { | 190 while (iter.next()) { |
192 iter->drawBitmap(bitmap, x, y, paint); | 191 iter->drawBitmap(bitmap, x, y, paint); |
193 } | 192 } |
194 } | 193 } |
195 | 194 |
196 void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c
onst SkRect& dst, | 195 void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c
onst SkRect& dst, |
197 const SkPaint* paint, DrawBitmapRectFlags fl
ags) { | 196 const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_
TYPE constraint) { |
198 Iter iter(fList); | 197 Iter iter(fList); |
199 while (iter.next()) { | 198 while (iter.next()) { |
200 iter->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 199 iter->drawBitmapRect(bitmap, src, dst, paint, (SrcRectConstraint)constra
int); |
201 } | 200 } |
202 } | 201 } |
203 | 202 |
204 void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cente
r, | 203 void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cente
r, |
205 const SkRect& dst, const SkPaint* paint) { | 204 const SkRect& dst, const SkPaint* paint) { |
206 Iter iter(fList); | 205 Iter iter(fList); |
207 while (iter.next()) { | 206 while (iter.next()) { |
208 iter->drawBitmapNine(bitmap, center, dst, paint); | 207 iter->drawBitmapNine(bitmap, center, dst, paint); |
209 } | 208 } |
210 } | 209 } |
211 | 210 |
212 void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top
, | 211 void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top
, |
213 const SkPaint* paint) { | 212 const SkPaint* paint) { |
214 Iter iter(fList); | 213 Iter iter(fList); |
215 while (iter.next()) { | 214 while (iter.next()) { |
216 iter->drawImage(image, left, top, paint); | 215 iter->drawImage(image, left, top, paint); |
217 } | 216 } |
218 } | 217 } |
219 | 218 |
220 void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons
t SkRect& dst, | 219 void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons
t SkRect& dst, |
221 const SkPaint* paint) { | 220 const SkPaint* paint SRC_RECT_CONSTRAINT_PARA
M(constraint)) { |
222 Iter iter(fList); | 221 Iter iter(fList); |
223 while (iter.next()) { | 222 while (iter.next()) { |
224 iter->drawImageRect(image, src, dst, paint); | 223 iter->drawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(const
raint)); |
225 } | 224 } |
226 } | 225 } |
227 | 226 |
228 void SkNWayCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPa
int* paint) { | 227 void SkNWayCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPa
int* paint) { |
229 Iter iter(fList); | 228 Iter iter(fList); |
230 while (iter.next()) { | 229 while (iter.next()) { |
231 iter->drawSprite(bitmap, x, y, paint); | 230 iter->drawSprite(bitmap, x, y, paint); |
232 } | 231 } |
233 } | 232 } |
234 | 233 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 300 } |
302 } | 301 } |
303 | 302 |
304 SkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) { | 303 SkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) { |
305 Iter iter(fList); | 304 Iter iter(fList); |
306 while (iter.next()) { | 305 while (iter.next()) { |
307 iter->setDrawFilter(filter); | 306 iter->setDrawFilter(filter); |
308 } | 307 } |
309 return this->INHERITED::setDrawFilter(filter); | 308 return this->INHERITED::setDrawFilter(filter); |
310 } | 309 } |
OLD | NEW |