Commit 7c892456 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Fix SharedImageBackingAHB unittests wrt thread safety changes

A previous patch disallowed creating legacy mailboxes in threadsafe mode,
but forgot to update unit test which tried to check this behavior.

As tests are now fixed, re-enabling on P-bot (P+ is required for these
tests) so we get coverage.

Bug: 1034007
Change-Id: I33f36800b9edcecc7df57c20529d874d8a2cbe7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978753Reviewed-by: default avatarvikas soni <vikassoni@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Auto-Submit: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726961}
parent d5a7ac72
...@@ -475,7 +475,7 @@ TEST_F(SharedImageBackingFactoryAHBTest, LegacyClearing) { ...@@ -475,7 +475,7 @@ TEST_F(SharedImageBackingFactoryAHBTest, LegacyClearing) {
return; return;
GlLegacySharedImage gl_legacy_shared_image{ GlLegacySharedImage gl_legacy_shared_image{
backing_factory_.get(), true /* is_thread_safe */, backing_factory_.get(), false /* is_thread_safe */,
&mailbox_manager_, &shared_image_manager_, &mailbox_manager_, &shared_image_manager_,
memory_type_tracker_.get(), shared_image_representation_factory_.get()}; memory_type_tracker_.get(), shared_image_representation_factory_.get()};
...@@ -552,24 +552,31 @@ GlLegacySharedImage::GlLegacySharedImage( ...@@ -552,24 +552,31 @@ GlLegacySharedImage::GlLegacySharedImage(
EXPECT_TRUE(backing_->IsCleared()); EXPECT_TRUE(backing_->IsCleared());
} }
// First, validate via a legacy mailbox.
GLenum expected_target = GL_TEXTURE_2D; GLenum expected_target = GL_TEXTURE_2D;
EXPECT_TRUE(backing_->ProduceLegacyMailbox(mailbox_manager_));
TextureBase* texture_base = mailbox_manager_->ConsumeTexture(mailbox_);
// Currently there is no support for passthrough texture on android and hence // First, validate via a legacy mailbox (only available when not
// in AHB backing. So the TextureBase* should be pointing to a Texture object. // |is_thread_safe|).
auto* texture = gles2::Texture::CheckedCast(texture_base); if (!is_thread_safe) {
EXPECT_TRUE(texture); EXPECT_TRUE(backing_->ProduceLegacyMailbox(mailbox_manager_));
EXPECT_EQ(texture->target(), expected_target);
EXPECT_TRUE(texture->IsImmutable()); TextureBase* texture_base = mailbox_manager_->ConsumeTexture(mailbox_);
int width, height, depth;
bool has_level = // Currently there is no support for passthrough texture on android and
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, &depth); // hence in AHB backing. So the TextureBase* should be pointing to a Texture
EXPECT_TRUE(has_level); // object.
EXPECT_EQ(width, size_.width()); auto* texture = gles2::Texture::CheckedCast(texture_base);
EXPECT_EQ(height, size_.height()); EXPECT_TRUE(texture);
EXPECT_EQ(texture->target(), expected_target);
EXPECT_TRUE(texture->IsImmutable());
int width, height, depth;
bool has_level =
texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, &depth);
EXPECT_TRUE(has_level);
EXPECT_EQ(width, size_.width());
EXPECT_EQ(height, size_.height());
} else {
EXPECT_FALSE(backing_->ProduceLegacyMailbox(mailbox_manager_));
}
shared_image_ = shared_image_ =
shared_image_manager->Register(std::move(backing_), memory_type_tracker); shared_image_manager->Register(std::move(backing_), memory_type_tracker);
......
...@@ -16,7 +16,3 @@ ...@@ -16,7 +16,3 @@
-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindSimpleVarAsArrayNoBind/1 -TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindSimpleVarAsArrayNoBind/1
-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/0 -TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/0
-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/1 -TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/1
-SharedImageBackingFactoryAHBTest.CannotWriteWhileReading
-SharedImageBackingFactoryAHBTest.CanHaveMultipleReaders
-SharedImageBackingFactoryAHBTest.CannotReadWhileWriting
-SharedImageBackingFactoryAHBTest.LegacyClearing
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