Commit 3cb1d430 authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

MailboxManagerSync: don't try to share textures with images

We can't bind 2 GLImage to the same textures, and it wouldn't work anyway.
Ensure we don't attempt to create an EGLImage in that case as it will break if
e.g. the image is in UNBOUND state.

Bug: 882513
Change-Id: Iea52d25771a43205a6250b0d354593af98676a86
Reviewed-on: https://chromium-review.googlesource.com/c/1330765Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607304}
parent d5a60033
...@@ -301,10 +301,10 @@ void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base, ...@@ -301,10 +301,10 @@ void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base,
if (definition.Matches(texture)) if (definition.Matches(texture))
return; return;
if (image && (!image_buffer || !image_buffer->IsClient(image))) { // Don't try to push updates to texture that have a bound image (not created
LOG(ERROR) << "MailboxSync: Incompatible attachment"; // by the MailboxManagerSync), as they were never shared to begin with.
if (image && (!image_buffer || !image_buffer->IsClient(image)))
return; return;
}
group->SetDefinition(TextureDefinition(texture, ++group_ref->version, group->SetDefinition(TextureDefinition(texture, ++group_ref->version,
image ? image_buffer : nullptr)); image ? image_buffer : nullptr));
......
...@@ -346,6 +346,9 @@ TextureDefinition::TextureDefinition( ...@@ -346,6 +346,9 @@ TextureDefinition::TextureDefinition(
if (!defined_) if (!defined_)
return; return;
if (!image_buffer_.get()) { if (!image_buffer_.get()) {
// Don't attempt to share textures that have bound images, as it can't work.
if (level->image)
return;
image_buffer_ = NativeImageBuffer::Create(texture->service_id()); image_buffer_ = NativeImageBuffer::Create(texture->service_id());
DCHECK(image_buffer_.get()); DCHECK(image_buffer_.get());
} }
......
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