aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2015-08-03 15:30:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-03 15:30:35 -0700
commit48ed62b29d45e42b971aac8858da06781c93e6d7 (patch)
treee58177b3135a7029760f69a032cab2b609401621 /src/core
parente00368018d993680017f425701f992f41bfa8d71 (diff)
SkCanvas::onDrawPicture() quick-reject
R=reed@google.com,mtklein@google.com Review URL: https://codereview.chromium.org/1264133003
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkCanvas.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 2308151b40..5f01bb5422 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2744,6 +2744,19 @@ void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, con
void SkCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
const SkPaint* paint) {
+ if (!paint || paint->canComputeFastBounds()) {
+ SkRect bounds = picture->cullRect();
+ if (paint) {
+ paint->computeFastBounds(bounds, &bounds);
+ }
+ if (matrix) {
+ matrix->mapRect(&bounds);
+ }
+ if (this->quickReject(bounds)) {
+ return;
+ }
+ }
+
SkBaseDevice* device = this->getTopDevice();
if (device) {
// Canvas has to first give the device the opportunity to render