OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasDrawable.h" | 9 #include "SkCanvasDrawable.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) | 2292 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) |
2293 | 2293 |
2294 while (iter.next()) { | 2294 while (iter.next()) { |
2295 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); | 2295 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); |
2296 } | 2296 } |
2297 | 2297 |
2298 LOOPER_END | 2298 LOOPER_END |
2299 } | 2299 } |
2300 | 2300 |
2301 void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) { | 2301 void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) { |
2302 if (dr) { | 2302 if (dr && !this->quickReject(dr->getBounds())) { |
2303 SkRect bounds; | 2303 this->onDrawDrawable(dr); |
2304 if (!dr->getBounds(&bounds) || !this->quickReject(bounds)) { | |
2305 this->onDrawDrawable(dr); | |
2306 } | |
2307 } | 2304 } |
2308 } | 2305 } |
2309 | 2306 |
2310 void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) { | 2307 void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) { |
2311 dr->draw(this); | 2308 dr->draw(this); |
2312 } | 2309 } |
2313 | 2310 |
2314 ////////////////////////////////////////////////////////////////////////////// | 2311 ////////////////////////////////////////////////////////////////////////////// |
2315 // These methods are NOT virtual, and therefore must call back into virtual | 2312 // These methods are NOT virtual, and therefore must call back into virtual |
2316 // methods, rather than actually drawing themselves. | 2313 // methods, rather than actually drawing themselves. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2584 } | 2581 } |
2585 | 2582 |
2586 if (matrix) { | 2583 if (matrix) { |
2587 canvas->concat(*matrix); | 2584 canvas->concat(*matrix); |
2588 } | 2585 } |
2589 } | 2586 } |
2590 | 2587 |
2591 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2588 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2592 fCanvas->restoreToCount(fSaveCount); | 2589 fCanvas->restoreToCount(fSaveCount); |
2593 } | 2590 } |
OLD | NEW |