[go: nahoru, domu]

Partial raster for GPU

Partial raster allows for significant savings during raster by allowing us to
rasterize on top of the previous content, only updating the areas which have
changed.

In order to leverage this optimization, the resource containing the previous
content must be unused and available for writing. Currently, the GPU raster
path isn't able to effectively leverage this optimization, as in nearly all cases,
the previous content is still in use (being displayed by the browser), and
cannot be overwritten with new updates.

To allow GPU raster to better leverage partial raster, this causes us to track
invalidations to a given resource over multiple frames. This allows us to use a
resource from two frames ago in partial raster (as opposed to just the most
recent frame). Resources from >1 frame in the past have a much higher
likelihood of being unused.

While this approach isn't perfect (you can't partial raster on the first change,
only subsequent ones) there is virtually no cost to it, which makes it a nice
starting point. Other approaches, such as copying in-use resources may be
investigated in the future if this technique produces insufficient results
compared to Software's Partial Raster numbers.

CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2110083004
Cr-Commit-Position: refs/heads/master@{#405379}
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc
index e33bb43..ecb8c825 100644
--- a/cc/raster/zero_copy_raster_buffer_provider.cc
+++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -116,7 +116,8 @@
   return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
 }
 
-bool ZeroCopyRasterBufferProvider::IsPartialRasterSupported() const {
+bool ZeroCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource()
+    const {
   return false;
 }