0

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/+/1775205
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691870}
This commit is contained in:
Vikas Soni
2019-08-30 00:13:31 +00:00
committed by Commit Bot
parent f5a9a69483
commit 46c88a3ffc
4 changed files with 7 additions and 6 deletions

@ -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 */);