| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
| 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 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 if (NULL != device) { | 2534 if (NULL != device) { |
| 2535 device->EXPERIMENTAL_optimize(picture); | 2535 device->EXPERIMENTAL_optimize(picture); |
| 2536 } | 2536 } |
| 2537 } | 2537 } |
| 2538 | 2538 |
| 2539 void SkCanvas::drawPicture(SkPicture& picture) { | 2539 void SkCanvas::drawPicture(SkPicture& picture) { |
| 2540 SkBaseDevice* device = this->getTopDevice(); | 2540 SkBaseDevice* device = this->getTopDevice(); |
| 2541 if (NULL != device) { | 2541 if (NULL != device) { |
| 2542 // Canvas has to first give the device the opportunity to render | 2542 // Canvas has to first give the device the opportunity to render |
| 2543 // the picture itself. | 2543 // the picture itself. |
| 2544 if (device->EXPERIMENTAL_drawPicture(picture)) { | 2544 if (device->EXPERIMENTAL_drawPicture(&picture)) { |
| 2545 return; // the device has rendered the entire picture | 2545 return; // the device has rendered the entire picture |
| 2546 } | 2546 } |
| 2547 } | 2547 } |
| 2548 | 2548 |
| 2549 picture.draw(this); | 2549 picture.draw(this); |
| 2550 } | 2550 } |
| 2551 | 2551 |
| 2552 /////////////////////////////////////////////////////////////////////////////// | 2552 /////////////////////////////////////////////////////////////////////////////// |
| 2553 /////////////////////////////////////////////////////////////////////////////// | 2553 /////////////////////////////////////////////////////////////////////////////// |
| 2554 | 2554 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2642 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2642 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
| 2643 return NULL; | 2643 return NULL; |
| 2644 } | 2644 } |
| 2645 | 2645 |
| 2646 // should this functionality be moved into allocPixels()? | 2646 // should this functionality be moved into allocPixels()? |
| 2647 if (!bitmap.info().isOpaque()) { | 2647 if (!bitmap.info().isOpaque()) { |
| 2648 bitmap.eraseColor(0); | 2648 bitmap.eraseColor(0); |
| 2649 } | 2649 } |
| 2650 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2650 return SkNEW_ARGS(SkCanvas, (bitmap)); |
| 2651 } | 2651 } |
| OLD | NEW |