Commit f6edf9d8 authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Use is_origin_top_left when creating shared images for Canvas

Recently SharedImageInterface::CreateSharedImage was changed to accept
the surface origin and alpha type of the shared image. This change
passes along |is_origin_left| for canvas resources which is necessary
for OOPR Canvas.

Bug: 1034086
Change-Id: I901b361bf6ad400d23cf9616a76df16afd94d0b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310609
Auto-Submit: Nathan Zabriskie <nazabris@microsoft.com>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790635}
parent 70565f67
......@@ -389,17 +389,21 @@ CanvasResourceRasterSharedImage::CanvasResourceRasterSharedImage(
gpu::SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT;
}
GrSurfaceOrigin surface_origin = is_origin_top_left_
? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin;
SkAlphaType surface_alpha_type = ColorParams().GetSkAlphaType();
gpu::Mailbox shared_image_mailbox;
if (gpu_memory_buffer_) {
shared_image_mailbox = shared_image_interface->CreateSharedImage(
gpu_memory_buffer_.get(), gpu_memory_buffer_manager,
ColorParams().GetStorageGfxColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, shared_image_usage_flags);
ColorParams().GetStorageGfxColorSpace(), surface_origin,
surface_alpha_type, shared_image_usage_flags);
} else {
shared_image_mailbox = shared_image_interface->CreateSharedImage(
ColorParams().TransferableResourceFormat(), gfx::Size(size),
ColorParams().GetStorageGfxColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, shared_image_usage_flags, gpu::kNullSurfaceHandle);
ColorParams().GetStorageGfxColorSpace(), surface_origin,
surface_alpha_type, shared_image_usage_flags, gpu::kNullSurfaceHandle);
}
// Wait for the mailbox to be ready to be used.
......@@ -738,13 +742,17 @@ CanvasResourceWebGPUSharedImage::CanvasResourceWebGPUSharedImage(
shared_image_usage_flags =
shared_image_usage_flags | gpu::SHARED_IMAGE_USAGE_WEBGPU;
GrSurfaceOrigin surface_origin = is_origin_top_left_
? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin;
gpu::Mailbox shared_image_mailbox;
shared_image_mailbox = shared_image_interface->CreateSharedImage(
ColorParams().TransferableResourceFormat(), gfx::Size(size),
ColorParams().GetStorageGfxColorSpace(), kTopLeft_GrSurfaceOrigin,
kPremul_SkAlphaType, shared_image_usage_flags, gpu::kNullSurfaceHandle);
ColorParams().GetStorageGfxColorSpace(), surface_origin,
ColorParams().GetSkAlphaType(), shared_image_usage_flags,
gpu::kNullSurfaceHandle);
auto* webgpu = WebGPUInterface();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment