[go: nahoru, domu]

[//cc] Add RasterBufferProvider::GetFormat() that returns SIF

The RasterBufferProvider interface currently has a pure virtual
GetResourceFormat() method. This CL does the following:

- Introduces a pure virtual RasterBufferProvider::GetFormat(), which
  returns SharedImageFormat
- Makes RasterBufferProvider::GetResourceFormat() a concrete method
  implemented on top of RasterBufferProvider::GetFormat()
- Changes subclasses to implement GetFormat()

Followup CLs will (a) change all clients of GetResourceFormat() and
eliminate that method, and (b) change RasterBufferProvider subclasses
to take in SharedImageFormat in their constructors.

Bug: 1378708
Change-Id: I48a8065f0f26a11a3660f7bf9455be4e652ae2f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4343298
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118553}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index d1f609033..4509f292 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -149,7 +149,7 @@
     : compositor_context_provider_(compositor_context_provider),
       worker_context_provider_(worker_context_provider),
       use_gpu_memory_buffer_resources_(use_gpu_memory_buffer_resources),
-      tile_format_(tile_format),
+      tile_format_(viz::SharedImageFormat::SinglePlane(tile_format)),
       max_tile_size_(max_tile_size),
       pending_raster_queries_(pending_raster_queries),
       raster_metric_probability_(raster_metric_probability),
@@ -195,7 +195,7 @@
   compositor_context_provider_->ContextSupport()->FlushPendingWork();
 }
 
-viz::ResourceFormat GpuRasterBufferProvider::GetResourceFormat() const {
+viz::SharedImageFormat GpuRasterBufferProvider::GetFormat() const {
   return tile_format_;
 }