| Index: src/core/SkCanvas.cpp
|
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
|
| index 53dec2ef4c77ec4553cf2471f3fa699ac008c452..3134c4668689b75323efb5de155037955bfbbe64 100644
|
| --- a/src/core/SkCanvas.cpp
|
| +++ b/src/core/SkCanvas.cpp
|
| @@ -2479,31 +2479,39 @@ void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength,
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| -void SkCanvas::EXPERIMENTAL_optimize(SkPicture* picture) {
|
| +void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) {
|
| SkBaseDevice* device = this->getDevice();
|
| if (NULL != device) {
|
| device->EXPERIMENTAL_optimize(picture);
|
| }
|
| }
|
|
|
| -void SkCanvas::EXPERIMENTAL_purge(SkPicture* picture) {
|
| +void SkCanvas::EXPERIMENTAL_purge(const SkPicture* picture) {
|
| SkBaseDevice* device = this->getTopDevice();
|
| if (NULL != device) {
|
| device->EXPERIMENTAL_purge(picture);
|
| }
|
| }
|
|
|
| -void SkCanvas::drawPicture(SkPicture& picture) {
|
| +void SkCanvas::drawPicture(const SkPicture* picture) {
|
| + if (NULL != picture) {
|
| + this->onDrawPicture(picture);
|
| + }
|
| +}
|
| +
|
| +void SkCanvas::onDrawPicture(const SkPicture* picture) {
|
| + SkASSERT(NULL != picture);
|
| +
|
| SkBaseDevice* device = this->getTopDevice();
|
| if (NULL != device) {
|
| // Canvas has to first give the device the opportunity to render
|
| // the picture itself.
|
| - if (device->EXPERIMENTAL_drawPicture(this, &picture)) {
|
| + if (device->EXPERIMENTAL_drawPicture(this, picture)) {
|
| return; // the device has rendered the entire picture
|
| }
|
| }
|
|
|
| - picture.draw(this);
|
| + picture->draw(this);
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|