summaryrefslogtreecommitdiffstats
path: root/cc/raster
diff options
context:
space:
mode:
authorkkinnunen <kkinnunen@nvidia.com>2016-02-12 02:08:12 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-12 10:09:29 +0000
commitadbacd950053d80419e4cfec6f998ccb470fc029 (patch)
tree5a4d115d09e5b6a22a92957b05c8b65430b0593a /cc/raster
parentdca8d578aa3ab16d5153fcd0c1220bc4e6fcc2e3 (diff)
downloadchromium_src-adbacd950053d80419e4cfec6f998ccb470fc029.zip
chromium_src-adbacd950053d80419e4cfec6f998ccb470fc029.tar.gz
chromium_src-adbacd950053d80419e4cfec6f998ccb470fc029.tar.bz2
cc: Avoid extra flush calls to Skia GrContext
Avoid calling GrContext::flush() upon every tile raster. The correct way to ensure rendering has been submitted to GPU API level is by "preparing for external io" the render target. This fixes the problem where Skia GPU resource cache resources grow old too quickly. Each flush will age the resources, and after becoming too old (64), the resources will be redundantly destroyed upon the next resource allocation. The flush is intended to be called at the rate the order of frames. Before this fix, the flush was called at least the amount relative to the amount of tiles. For MSAA, flush was called more than one time per tile. This fix reduces the amount of flushes. Also, after this fix the effect of potential extra flushes can be fixed in Skia. BUG=582858 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1653983002 Cr-Commit-Position: refs/heads/master@{#375152}
Diffstat (limited to 'cc/raster')
-rw-r--r--cc/raster/gpu_rasterizer.cc2
-rw-r--r--cc/raster/scoped_gpu_raster.cc3
2 files changed, 1 insertions, 4 deletions
diff --git a/cc/raster/gpu_rasterizer.cc b/cc/raster/gpu_rasterizer.cc
index b8ad862..2dcd8e0 100644
--- a/cc/raster/gpu_rasterizer.cc
+++ b/cc/raster/gpu_rasterizer.cc
@@ -79,7 +79,7 @@ void GpuRasterizer::RasterizeSource(
SkMultiPictureDraw multi_picture_draw;
multi_picture_draw.add(sk_surface->getCanvas(), picture.get());
- multi_picture_draw.draw(msaa_sample_count_ > 0);
+ multi_picture_draw.draw(false);
write_lock->ReleaseSkSurface();
}
}
diff --git a/cc/raster/scoped_gpu_raster.cc b/cc/raster/scoped_gpu_raster.cc
index e6dcf23..9807c29 100644
--- a/cc/raster/scoped_gpu_raster.cc
+++ b/cc/raster/scoped_gpu_raster.cc
@@ -34,9 +34,6 @@ void ScopedGpuRaster::BeginGpuRaster() {
}
void ScopedGpuRaster::EndGpuRaster() {
- class GrContext* gr_context = context_provider_->GrContext();
- gr_context->flush();
-
GLES2Interface* gl = context_provider_->ContextGL();
// Restore default GL unpack alignment. TextureUploader expects this.