[go: nahoru, domu]

RawDraw: count half of memory usage for raw draw tiles

For raw draw, we found chrome uses about 50% less GPU memory compare to
non raw draw. So this CL changes the memory usage for tiles backed by
raw draw shared image backing, and then tile manager can keep more tiles
alive.

Bug: 1254682
Change-Id: If3c8e2e23f0a7f5dfe7ea477ee3f1017d89c0e75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3448469
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#968600}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index 8a668a7..1aba1ac 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -181,6 +181,8 @@
     backing->InitOverlayCandidateAndTextureTarget(
         resource.format(), compositor_context_provider_->ContextCapabilities(),
         use_gpu_memory_buffer_resources_);
+    backing->is_using_raw_draw =
+        !backing->overlay_candidate && is_using_raw_draw_;
     resource.set_gpu_backing(std::move(backing));
   }
   GpuRasterBacking* backing =