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

Unified Diff: cc/resources/picture.cc

Issue 595553002: Use the skmultipicture to perform GPU rasterization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comment and bad if statement Created 6 years, 3 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
« no previous file with comments | « cc/resources/gpu_raster_worker_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index adc85de3d53e2610a45a780ca35daf41a05722d4..ec1f333f1f251f098e51c83107e1652cdd91721e 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -350,8 +350,14 @@ int Picture::Raster(SkCanvas* canvas,
canvas->translate(layer_rect_.x(), layer_rect_.y());
if (playback_) {
playback_->draw(canvas);
- } else {
+ } else if (callback) {
+ // If we have a callback, we need to call |draw()|, |drawPicture()| doesn't
+ // take a callback. This is used by |AnalysisCanvas| to early out.
picture_->draw(canvas, callback);
+ } else {
+ // Prefer to call |drawPicture()| on the canvas since it could place the
+ // entire picture on the canvas instead of parsing the skia operations.
+ canvas->drawPicture(picture_.get());
}
SkIRect bounds;
canvas->getClipDeviceBounds(&bounds);
« no previous file with comments | « cc/resources/gpu_raster_worker_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698