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 "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 11 #include "SkBitmapDevice.h" |
11 #include "SkDeviceImageFilterProxy.h" | 12 #include "SkDeviceImageFilterProxy.h" |
12 #include "SkDraw.h" | 13 #include "SkDraw.h" |
13 #include "SkDrawFilter.h" | 14 #include "SkDrawFilter.h" |
14 #include "SkDrawLooper.h" | 15 #include "SkDrawLooper.h" |
15 #include "SkImage.h" | 16 #include "SkImage.h" |
16 #include "SkMetaData.h" | 17 #include "SkMetaData.h" |
17 #include "SkPathOps.h" | 18 #include "SkPathOps.h" |
18 #include "SkPatchUtils.h" | 19 #include "SkPatchUtils.h" |
(...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 | 2298 |
2298 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) | 2299 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) |
2299 | 2300 |
2300 while (iter.next()) { | 2301 while (iter.next()) { |
2301 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); | 2302 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); |
2302 } | 2303 } |
2303 | 2304 |
2304 LOOPER_END | 2305 LOOPER_END |
2305 } | 2306 } |
2306 | 2307 |
| 2308 void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) { |
| 2309 if (dr) { |
| 2310 SkRect bounds; |
| 2311 if (!dr->getBounds(&bounds) || !this->quickReject(bounds)) { |
| 2312 this->onDrawDrawable(dr); |
| 2313 } |
| 2314 } |
| 2315 } |
| 2316 |
| 2317 void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) { |
| 2318 dr->draw(this); |
| 2319 } |
| 2320 |
2307 ////////////////////////////////////////////////////////////////////////////// | 2321 ////////////////////////////////////////////////////////////////////////////// |
2308 // These methods are NOT virtual, and therefore must call back into virtual | 2322 // These methods are NOT virtual, and therefore must call back into virtual |
2309 // methods, rather than actually drawing themselves. | 2323 // methods, rather than actually drawing themselves. |
2310 ////////////////////////////////////////////////////////////////////////////// | 2324 ////////////////////////////////////////////////////////////////////////////// |
2311 | 2325 |
2312 void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, | 2326 void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, |
2313 SkXfermode::Mode mode) { | 2327 SkXfermode::Mode mode) { |
2314 TRACE_EVENT0("skia", "SkCanvas::drawARGB()"); | 2328 TRACE_EVENT0("skia", "SkCanvas::drawARGB()"); |
2315 SkPaint paint; | 2329 SkPaint paint; |
2316 | 2330 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 } | 2591 } |
2578 | 2592 |
2579 if (matrix) { | 2593 if (matrix) { |
2580 canvas->concat(*matrix); | 2594 canvas->concat(*matrix); |
2581 } | 2595 } |
2582 } | 2596 } |
2583 | 2597 |
2584 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2598 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2585 fCanvas->restoreToCount(fSaveCount); | 2599 fCanvas->restoreToCount(fSaveCount); |
2586 } | 2600 } |
OLD | NEW |