0

Fix surface origin in ExternalVkImage

We create SharedImage with kBottomLeft origin for readback [1].
On linux/Vulkan it will be ExternalVkImage. This CL fixes origin for
SkSurface in skia representation which was incorrectly coded as
kTopLeft.

[1] https://source.chromium.org/chromium/chromium/src/+/master:components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc;l=1012;drc=da0d28ea20bf524ea8071cd6a7b8810634e61a5d

Bug: 1203256
Change-Id: Iba129f2edb93d57666074a666312ff8b462c0943
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2852325
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#876697}
This commit is contained in:
Vasiliy Telezhnikov
2021-04-27 19:18:44 +00:00
committed by Chromium LUCI CQ
parent 76c27c53d1
commit bf1a3eda93

@ -62,7 +62,7 @@ sk_sp<SkSurface> ExternalVkImageSkiaRepresentation::BeginWriteAccess(
SkColorType sk_color_type = viz::ResourceFormatToClosestSkColorType(
true /* gpu_compositing */, format());
surface = SkSurface::MakeFromBackendTexture(
gr_context, promise_texture->backendTexture(), kTopLeft_GrSurfaceOrigin,
gr_context, promise_texture->backendTexture(), surface_origin(),
final_msaa_count, sk_color_type,
backing_impl()->color_space().ToSkColorSpace(), &surface_props);
if (!surface) {