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 | 8 |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 } | 2379 } |
2380 | 2380 |
2381 /////////////////////////////////////////////////////////////////////////////// | 2381 /////////////////////////////////////////////////////////////////////////////// |
2382 void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) { | 2382 void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) { |
2383 SkBaseDevice* device = this->getDevice(); | 2383 SkBaseDevice* device = this->getDevice(); |
2384 if (NULL != device) { | 2384 if (NULL != device) { |
2385 device->EXPERIMENTAL_optimize(picture); | 2385 device->EXPERIMENTAL_optimize(picture); |
2386 } | 2386 } |
2387 } | 2387 } |
2388 | 2388 |
2389 void SkCanvas::EXPERIMENTAL_purge(const SkPicture* picture) { | |
2390 SkBaseDevice* device = this->getTopDevice(); | |
2391 if (NULL != device) { | |
2392 device->EXPERIMENTAL_purge(picture); | |
2393 } | |
2394 } | |
2395 | |
2396 void SkCanvas::drawPicture(const SkPicture* picture) { | 2389 void SkCanvas::drawPicture(const SkPicture* picture) { |
2397 if (NULL != picture) { | 2390 if (NULL != picture) { |
2398 this->onDrawPicture(picture); | 2391 this->onDrawPicture(picture); |
2399 } | 2392 } |
2400 } | 2393 } |
2401 | 2394 |
2402 void SkCanvas::onDrawPicture(const SkPicture* picture) { | 2395 void SkCanvas::onDrawPicture(const SkPicture* picture) { |
2403 SkASSERT(NULL != picture); | 2396 SkASSERT(NULL != picture); |
2404 | 2397 |
2405 SkBaseDevice* device = this->getTopDevice(); | 2398 SkBaseDevice* device = this->getTopDevice(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 if (!supported_for_raster_canvas(info)) { | 2495 if (!supported_for_raster_canvas(info)) { |
2503 return NULL; | 2496 return NULL; |
2504 } | 2497 } |
2505 | 2498 |
2506 SkBitmap bitmap; | 2499 SkBitmap bitmap; |
2507 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2500 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2508 return NULL; | 2501 return NULL; |
2509 } | 2502 } |
2510 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2503 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2511 } | 2504 } |
OLD | NEW |