| 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::drawPatch(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) { |
| 290 if (NULL == cubics) { |
| 291 return; |
| 292 } |
| 293 |
| 289 SkRect bbox; | 294 SkRect bbox; |
| 290 bbox.set(points, SkPatch::kNumCtrlPts); | 295 bbox.set(cubics, SkPatch::kNumCtrlPts); |
| 291 if (this->transformBounds(bbox, &paint)) { | 296 if (this->transformBounds(bbox, &paint)) { |
| 292 INHERITED::drawPatch(patch, paint); | 297 INHERITED::drawPatch(cubics, colors, texCoords, xmode, paint); |
| 293 } | 298 } |
| 294 } | 299 } |
| 295 | 300 |
| 296 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, | 301 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, |
| 297 const SkPaint* paint) { | 302 const SkPaint* paint) { |
| 298 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), | 303 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), |
| 299 SkIntToScalar(picture->height())); | 304 SkIntToScalar(picture->height())); |
| 300 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't | 305 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't |
| 301 // end up transforming the rect twice. | 306 // end up transforming the rect twice. |
| 302 if (matrix) { | 307 if (matrix) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 } | 359 } |
| 355 | 360 |
| 356 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 361 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
| 357 this->getTotalMatrix().mapRect(&outBounds); | 362 this->getTotalMatrix().mapRect(&outBounds); |
| 358 this->handleBBox(outBounds); | 363 this->handleBBox(outBounds); |
| 359 return true; | 364 return true; |
| 360 } | 365 } |
| 361 | 366 |
| 362 return false; | 367 return false; |
| 363 } | 368 } |
| OLD | NEW |