| 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 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 const SkPaint& paint) { | 306 const SkPaint& paint) { |
| 307 SkRect bbox; | 307 SkRect bbox; |
| 308 bbox.set(cubics, SkPatchUtils::kNumCtrlPts); | 308 bbox.set(cubics, SkPatchUtils::kNumCtrlPts); |
| 309 if (this->transformBounds(bbox, &paint)) { | 309 if (this->transformBounds(bbox, &paint)) { |
| 310 INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, paint); | 310 INHERITED::onDrawPatch(cubics, colors, texCoords, xmode, paint); |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, | 314 void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, |
| 315 const SkPaint* paint) { | 315 const SkPaint* paint) { |
| 316 SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), | 316 SkRect bounds = picture->cullRect(); |
| 317 SkIntToScalar(picture->height())); | |
| 318 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't | 317 // todo: wonder if we should allow passing an optional matrix to transformBo
unds so we don't |
| 319 // end up transforming the rect twice. | 318 // end up transforming the rect twice. |
| 320 if (matrix) { | 319 if (matrix) { |
| 321 matrix->mapRect(&bounds); | 320 matrix->mapRect(&bounds); |
| 322 } | 321 } |
| 323 if (this->transformBounds(bounds, paint)) { | 322 if (this->transformBounds(bounds, paint)) { |
| 324 this->INHERITED::onDrawPicture(picture, matrix, paint); | 323 this->INHERITED::onDrawPicture(picture, matrix, paint); |
| 325 } | 324 } |
| 326 } | 325 } |
| 327 | 326 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 371 } |
| 373 | 372 |
| 374 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 373 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
| 375 this->getTotalMatrix().mapRect(&outBounds); | 374 this->getTotalMatrix().mapRect(&outBounds); |
| 376 this->handleBBox(outBounds); | 375 this->handleBBox(outBounds); |
| 377 return true; | 376 return true; |
| 378 } | 377 } |
| 379 | 378 |
| 380 return false; | 379 return false; |
| 381 } | 380 } |
| OLD | NEW |