Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/core/SkCanvas.cpp

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
///////////////////////////////////////////////////////////////////////////////
« include/core/SkCanvas.h ('K') | « src/core/SkBBoxRecord.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698