Commit 46c88a3f authored by Vikas Soni's avatar Vikas Soni Committed by Commit Bot

Fix android video for SkiaRenderer GL mode.

SkiaRenderer GL mode started failing recently because
StreamTextureSharedImageInterface can now be initialized later
(MCVD path) after creating the shared image in which case
StreamTextureSharedImageInterface don't have gfx::Size information
at shared image construction time.
This CL fixes above issue by passing gfx::Size param explicitly in
constructor.

Vulkan mode is still broken and will be fixed by a follow up CL.

Change-Id: Ib57378cae09d6bee9200219d6743baf811fafa50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775205Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691870}
parent f5a9a694
......@@ -113,6 +113,7 @@ void DestroyVkPromiseTexture(viz::VulkanContextProvider* context_provider,
SharedImageVideo::SharedImageVideo(
const Mailbox& mailbox,
const gfx::Size& size,
const gfx::ColorSpace color_space,
scoped_refptr<StreamTextureSharedImageInterface> stream_texture_sii,
std::unique_ptr<gles2::AbstractTexture> abstract_texture,
......@@ -121,12 +122,11 @@ SharedImageVideo::SharedImageVideo(
: SharedImageBacking(
mailbox,
viz::RGBA_8888,
stream_texture_sii->GetSize(),
size,
color_space,
(SHARED_IMAGE_USAGE_DISPLAY | SHARED_IMAGE_USAGE_GLES2),
viz::ResourceSizes::UncheckedSizeInBytes<size_t>(
stream_texture_sii->GetSize(),
viz::RGBA_8888),
viz::ResourceSizes::UncheckedSizeInBytes<size_t>(size,
viz::RGBA_8888),
is_thread_safe),
stream_texture_sii_(std::move(stream_texture_sii)),
abstract_texture_(std::move(abstract_texture)),
......
......@@ -32,6 +32,7 @@ class GPU_GLES2_EXPORT SharedImageVideo
public:
SharedImageVideo(
const Mailbox& mailbox,
const gfx::Size& size,
const gfx::ColorSpace color_space,
scoped_refptr<StreamTextureSharedImageInterface> stream_texture_sii,
std::unique_ptr<gles2::AbstractTexture> abstract_texture,
......
......@@ -298,7 +298,7 @@ void StreamTexture::OnCreateSharedImage(const gpu::Mailbox& mailbox,
// TODO(vikassoni): Hardcoding colorspace to SRGB. Figure how if we have a
// colorspace and wire it here.
auto shared_image = std::make_unique<SharedImageVideo>(
mailbox, gfx::ColorSpace::CreateSRGB(), this,
mailbox, size_, gfx::ColorSpace::CreateSRGB(), this,
std::move(legacy_mailbox_texture), context_state_, false);
channel_->shared_image_stub()->factory()->RegisterBacking(
std::move(shared_image), true /* allow_legacy_mailbox */);
......
......@@ -239,7 +239,7 @@ bool GpuSharedImageVideoFactory::CreateImageInternal(
// TODO(vikassoni): This shared image need to be thread safe eventually for
// webview to work with shared images.
auto shared_image = std::make_unique<gpu::SharedImageVideo>(
mailbox, gfx::ColorSpace::CreateSRGB(), std::move(image),
mailbox, size, gfx::ColorSpace::CreateSRGB(), std::move(image),
std::move(texture), std::move(shared_context),
false /* is_thread_safe */);
......
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