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

Unified Diff: cc/raster/gpu_rasterizer.cc

Issue 1653983002: cc: Avoid extra flush calls to Skia GrContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | cc/raster/scoped_gpu_raster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/gpu_rasterizer.cc
diff --git a/cc/raster/gpu_rasterizer.cc b/cc/raster/gpu_rasterizer.cc
index 9525d8f9f2220e8e5085b17f9ddb7d30bb848f29..8beaccd11ab7fadcc923a026731a3aaef5515e20 100644
--- a/cc/raster/gpu_rasterizer.cc
+++ b/cc/raster/gpu_rasterizer.cc
@@ -79,7 +79,16 @@ void GpuRasterizer::RasterizeSource(
SkMultiPictureDraw multi_picture_draw;
multi_picture_draw.add(sk_surface->getCanvas(), picture.get());
- multi_picture_draw.draw(msaa_sample_count_ > 0);
+ // This is undocumented:
bsalomon 2016/02/01 14:55:59 What is undocumented? Are we missing something on
+ // SkCanvas::flush must be explicitly called in order to flush possibly
+ // deferred rendering in SkGpuDevice.
+ // This also prepares the GrRenderTarget of the sk_surface for external
+ // read.
+ // Correct point of preparing would be in
+ // ScopedWriteLockGr::ReleaseSkSurface, but this would be redundant, as
+ // SkGpuDevice::flush forces it.
+ // Passing true SkMultiPictureDraw::draw(bool flush) makes this happen.
+ multi_picture_draw.draw(true);
write_lock->ReleaseSkSurface();
}
}
« no previous file with comments | « no previous file | cc/raster/scoped_gpu_raster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698