OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 | 8 |
9 #include "SkBBoxRecord.h" | 9 #include "SkBBoxRecord.h" |
10 | 10 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const uint16_t indices[], int indexCount, | 277 const uint16_t indices[], int indexCount, |
278 const SkPaint& paint) { | 278 const SkPaint& paint) { |
279 SkRect bbox; | 279 SkRect bbox; |
280 bbox.set(vertices, vertexCount); | 280 bbox.set(vertices, vertexCount); |
281 if (this->transformBounds(bbox, &paint)) { | 281 if (this->transformBounds(bbox, &paint)) { |
282 INHERITED::drawVertices(mode, vertexCount, vertices, texs, | 282 INHERITED::drawVertices(mode, vertexCount, vertices, texs, |
283 colors, xfer, indices, indexCount, paint); | 283 colors, xfer, indices, indexCount, paint); |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 void SkBBoxRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) { | 287 void SkBBoxRecord::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
, |
288 const SkPoint* points = patch.getControlPoints(); | 288 const SkPoint texCoords[4], SkXfermode* xmode, |
| 289 const SkPaint& paint) { |
289 SkRect bbox; | 290 SkRect bbox; |
290 bbox.set(points, SkPatch::kNumCtrlPts); | 291 bbox.set(cubics, SkPatchUtils::kNumCtrlPts); |
291 if (this->transformBounds(bbox, &paint)) { | 292 if (this->transformBounds(bbox, &paint)) { |
292 INHERITED::drawPatch(patch, paint); | 293 INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, paint); |
293 } | 294 } |
294 } | 295 } |
295 | 296 |
296 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, | 297 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, |
297 const SkPaint* paint) { | 298 const SkPaint* paint) { |
298 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), | 299 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), |
299 SkIntToScalar(picture->height())); | 300 SkIntToScalar(picture->height())); |
300 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't | 301 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't |
301 // end up transforming the rect twice. | 302 // end up transforming the rect twice. |
302 if (matrix) { | 303 if (matrix) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 } | 355 } |
355 | 356 |
356 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 357 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
357 this->getTotalMatrix().mapRect(&outBounds); | 358 this->getTotalMatrix().mapRect(&outBounds); |
358 this->handleBBox(outBounds); | 359 this->handleBBox(outBounds); |
359 return true; | 360 return true; |
360 } | 361 } |
361 | 362 |
362 return false; | 363 return false; |
363 } | 364 } |
OLD | NEW |