Index: src/core/SkCanvas.cpp |
=================================================================== |
--- src/core/SkCanvas.cpp (revision 13812) |
+++ src/core/SkCanvas.cpp (working copy) |
@@ -2461,8 +2461,23 @@ |
} |
/////////////////////////////////////////////////////////////////////////////// |
+void SkCanvas::EXPERIMENTAL_optimize(SkPicture* picture) { |
+ SkBaseDevice* device = this->getDevice(); |
+ if (NULL != device) { |
+ device->EXPERIMENTAL_optimize(picture); |
+ } |
+} |
void SkCanvas::drawPicture(SkPicture& 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(picture)) { |
+ return; // the device has rendered the entire picture |
+ } |
+ } |
+ |
picture.draw(this); |
} |