[//gpu] Be explicit about all RawDraw backing usages being required
Unlike most SharedImage backing factories, RawDrawImageBackingFactory requires an exact set of usages that match its expected use. This CL makes this situation more explicit via a variable rename and addition of a comment. Bug: 341801008 Change-Id: I9714f7dc48f83dd71da632a798933060bf05573d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569132 Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/main@{#1305713}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
186947e39c
commit
02bd9d6c1e
@ -9,15 +9,19 @@
|
||||
#include "gpu/command_buffer/service/shared_image/raw_draw_image_backing.h"
|
||||
|
||||
namespace gpu {
|
||||
// NOTE: `SHARED_IMAGE_USAGE_RASTER_OVER_GLES2_ONLY` is not supported as RawDraw
|
||||
// NOTE: These are the *exact* set of usages that the client must list in order
|
||||
// for the RawDraw backing to be applied. The client must explicitly opt into
|
||||
// using RawDraw, and that only in the expected context of rasterizing content
|
||||
// via OOP-raster into PaintOps to play back during compositing.
|
||||
// NOTE: `SHARED_IMAGE_USAGE_RASTER_OVER_GLES2_ONLY` is not listed as RawDraw
|
||||
// works only with OOP-raster (since it must store PaintOps for playback during
|
||||
// compositing).
|
||||
constexpr uint32_t kSupportedUsage =
|
||||
constexpr uint32_t kRequiredUsage =
|
||||
SHARED_IMAGE_USAGE_DISPLAY_READ | SHARED_IMAGE_USAGE_RASTER_WRITE |
|
||||
SHARED_IMAGE_USAGE_OOP_RASTERIZATION | SHARED_IMAGE_USAGE_RAW_DRAW;
|
||||
|
||||
RawDrawImageBackingFactory::RawDrawImageBackingFactory()
|
||||
: SharedImageBackingFactory(kSupportedUsage) {}
|
||||
: SharedImageBackingFactory(kRequiredUsage) {}
|
||||
|
||||
RawDrawImageBackingFactory::~RawDrawImageBackingFactory() = default;
|
||||
|
||||
@ -89,7 +93,7 @@ RawDrawImageBackingFactory::CreateSharedImage(
|
||||
bool RawDrawImageBackingFactory::CanUseRawDrawImageBacking(
|
||||
uint32_t usage,
|
||||
GrContextType gr_context_type) const {
|
||||
return usage == kSupportedUsage;
|
||||
return usage == kRequiredUsage;
|
||||
}
|
||||
|
||||
bool RawDrawImageBackingFactory::IsSupported(
|
||||
|
Reference in New Issue
Block a user