[//cc] Change {InUse}PoolResource::format() to return SharedImageFormat
This CL changes {InUse}PoolResource::format() to return
SharedImageFormat as part of the ongoing conversion of the codebase from
ResourceFormat to SIF. Followup work will extend the conversion out to
ResourcePool::AcquireResource(), which has many callers.
Bug: 1378708
Change-Id: Ib5d2933a5ceef91b15ab97ee32abab8f8e400a81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4353133
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119868}
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc
index e7c614c..3136868 100644
--- a/cc/raster/zero_copy_raster_buffer_provider.cc
+++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -75,7 +75,7 @@
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
shutdown_event_(shutdown_event),
resource_size_(in_use_resource.size()),
- format_(viz::SharedImageFormat::SinglePlane(in_use_resource.format())),
+ format_(in_use_resource.format()),
resource_color_space_(in_use_resource.color_space()),
gpu_memory_buffer_(std::move(backing_->gpu_memory_buffer)) {}
ZeroCopyRasterBufferImpl(const ZeroCopyRasterBufferImpl&) = delete;
@@ -191,7 +191,7 @@
const gpu::Capabilities& caps =
compositor_context_provider_->ContextCapabilities();
backing->texture_target = gpu::GetBufferTextureTarget(
- kBufferUsage, BufferFormat(resource.format()), caps);
+ kBufferUsage, BufferFormat(resource.format().resource_format()), caps);
backing->overlay_candidate = true;
// This RasterBufferProvider will modify the resource outside of the
// GL command stream. So resources should not become available for reuse