[go: nahoru, domu]

Make RasterBufferProvider self-flushing.

Forcing the caller to Flush() was brittle (crbug.com/1421227).  Now
TileManager sometimes flushes unnecessarily (PrepareToDraw if no raster
work has occurred), and in a few places seems like it might still fail
to flush when it should.

By moving the flush logic into the RasterBufferProvider implementation
we can be more confident about correctness as well as more performant.

Bug: 1369739
Change-Id: Iedbb5d9d5f92c7886bb01e17c3f7381a33f7e400
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4604470
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1166160}
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc
index 07feda3..f9e8afb0 100644
--- a/cc/raster/zero_copy_raster_buffer_provider.cc
+++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -228,7 +228,7 @@
 }
 
 bool ZeroCopyRasterBufferProvider::IsResourceReadyToDraw(
-    const ResourcePool::InUsePoolResource& resource) const {
+    const ResourcePool::InUsePoolResource& resource) {
   // Zero-copy resources are immediately ready to draw.
   return true;
 }
@@ -236,7 +236,7 @@
 uint64_t ZeroCopyRasterBufferProvider::SetReadyToDrawCallback(
     const std::vector<const ResourcePool::InUsePoolResource*>& resources,
     base::OnceClosure callback,
-    uint64_t pending_callback_id) const {
+    uint64_t pending_callback_id) {
   // Zero-copy resources are immediately ready to draw.
   return 0;
 }