Commit 69ffdad6 authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

gpu: Don't use GL shared image backing for scanout images.

Images that need to support scanout on Android require explicit fence
synchronization which is not support by the GL backing. Ideally it
shouldn't have to be because scanout should use the AHB backing which
already has support for this.

R=penghuang@chromium.org

Bug: 1085485,1082519
Change-Id: Ib6bdd9f46ca31a81e764c9bd46693a6b5e302f5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212811
Commit-Queue: Khushal <khushalsagar@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771248}
parent 6b805f8c
...@@ -357,31 +357,6 @@ class SharedImageRepresentationGLTexturePassthroughImpl ...@@ -357,31 +357,6 @@ class SharedImageRepresentationGLTexturePassthroughImpl
scoped_refptr<gles2::TexturePassthrough> texture_passthrough_; scoped_refptr<gles2::TexturePassthrough> texture_passthrough_;
}; };
class SharedImageRepresentationOverlayImpl
: public SharedImageRepresentationOverlay {
public:
SharedImageRepresentationOverlayImpl(SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
gl::GLImage* gl_image)
: SharedImageRepresentationOverlay(manager, backing, tracker),
gl_image_(gl_image) {}
~SharedImageRepresentationOverlayImpl() override = default;
#if defined(OS_ANDROID)
void NotifyOverlayPromotion(bool promotion,
const gfx::Rect& bounds) override {
NOTIMPLEMENTED() << "Promotion hints are only required for media overlays";
}
#endif
bool BeginReadAccess() override { return true; }
void EndReadAccess() override {}
gl::GLImage* GetGLImage() override { return gl_image_; }
private:
gl::GLImage* gl_image_;
};
class SharedImageBackingWithReadAccess : public SharedImageBacking { class SharedImageBackingWithReadAccess : public SharedImageBacking {
public: public:
SharedImageBackingWithReadAccess(const Mailbox& mailbox, SharedImageBackingWithReadAccess(const Mailbox& mailbox,
...@@ -635,20 +610,6 @@ class SharedImageBackingGLTexture : public SharedImageBackingWithReadAccess { ...@@ -635,20 +610,6 @@ class SharedImageBackingGLTexture : public SharedImageBackingWithReadAccess {
manager, this, tracker, texture_); manager, this, tracker, texture_);
} }
std::unique_ptr<SharedImageRepresentationOverlay> ProduceOverlay(
SharedImageManager* manager,
MemoryTypeTracker* tracker) override {
gl::GLImage* image =
texture_->GetLevelImage(texture_->target(), 0, nullptr);
if (!image) {
LOG(ERROR)
<< "Trying to create overlay representation from a native GL texture";
return nullptr;
}
return std::make_unique<SharedImageRepresentationOverlayImpl>(
manager, this, tracker, image);
}
std::unique_ptr<SharedImageRepresentationGLTexture> std::unique_ptr<SharedImageRepresentationGLTexture>
ProduceRGBEmulationGLTexture(SharedImageManager* manager, ProduceRGBEmulationGLTexture(SharedImageManager* manager,
MemoryTypeTracker* tracker) override { MemoryTypeTracker* tracker) override {
......
...@@ -391,6 +391,12 @@ SharedImageBackingFactory* SharedImageFactory::GetFactoryByUsage( ...@@ -391,6 +391,12 @@ SharedImageBackingFactory* SharedImageFactory::GetFactoryByUsage(
(usage & SHARED_IMAGE_USAGE_VIDEO_DECODE) || (usage & SHARED_IMAGE_USAGE_VIDEO_DECODE) ||
(share_between_threads && vulkan_usage); (share_between_threads && vulkan_usage);
#if defined(OS_ANDROID)
// Scanout on Android requires explicit fence synchronization which is only
// supported by the interop factory.
using_interop_factory |= usage & SHARED_IMAGE_USAGE_SCANOUT;
#endif
// wrapped_sk_image_factory_ is only used for OOPR and supports // wrapped_sk_image_factory_ is only used for OOPR and supports
// a limited number of flags (e.g. no SHARED_IMAGE_USAGE_SCANOUT). // a limited number of flags (e.g. no SHARED_IMAGE_USAGE_SCANOUT).
constexpr auto kWrappedSkImageUsage = SHARED_IMAGE_USAGE_RASTER | constexpr auto kWrappedSkImageUsage = SHARED_IMAGE_USAGE_RASTER |
......
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