[Fuchsia] Allow fuchsia videos to be promoted as overlays
This CL adds the necessary steps to allow fuchsia video frames that
are associated with an independent ImagePipe to be promoted as
overlays. This is mostly done though NativePixmap interface.
- Note that, "use-overlays-for-video" flag added in a previous CL
allows fuchsia to associate video frames with an independent
ImagePipe through ScenicOverlayView class.
- Adding NativePixmap::SupportsOverlayPlane() to query platform
specific instances for overlay support. Fuchsia's SysmemNativePixmap
checks for ScenicOverlayView association.
- Add OverlayManagerScenic to filter overlay candidates.
- Allow access to the underlying pixmap in SharedImageInterface
through gpu::VulkanImage.
Bug: 1127984
Change-Id: I1f76deb28c4b94e948f600061caf7215f2ee1382
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446523
Commit-Queue: Emircan Uysaler <emircan@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817209}
This commit is contained in:

committed by
Commit Bot

parent
aa0cbec0d8
commit
69be7e48c1
components/viz/service
display
display_embedder
gpu
ui/ozone/platform/scenic
@ -9,6 +9,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/viz/common/features.h"
|
||||
#include "components/viz/service/display/overlay_strategy_fullscreen.h"
|
||||
#include "components/viz/service/display/overlay_strategy_single_on_top.h"
|
||||
@ -131,6 +132,9 @@ void OverlayProcessorOzone::CheckOverlaySupport(
|
||||
// For ozone-cast, there will not be a primary_plane.
|
||||
if (primary_plane) {
|
||||
ConvertToOzoneOverlaySurface(*primary_plane, &(*ozone_surface_iterator));
|
||||
// TODO(crbug.com/1138568): Fuchsia claims support for presenting primary
|
||||
// plane as overlay, but does not provide a mailbox. Handle this case.
|
||||
#if !defined(OS_FUCHSIA)
|
||||
if (shared_image_interface_) {
|
||||
bool result = SetNativePixmapForCandidate(&(*ozone_surface_iterator),
|
||||
primary_plane->mailbox);
|
||||
@ -143,6 +147,7 @@ void OverlayProcessorOzone::CheckOverlaySupport(
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ozone_surface_iterator++;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "gpu/vulkan/vulkan_function_pointers.h"
|
||||
#include "gpu/vulkan/vulkan_implementation.h"
|
||||
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
|
||||
#include "ui/gfx/geometry/rect_conversions.h"
|
||||
#include "ui/ozone/public/platform_window_surface.h"
|
||||
|
||||
namespace viz {
|
||||
@ -181,6 +182,7 @@ void OutputPresenterFuchsia::InitializeCapabilities(
|
||||
capabilities->output_surface_origin = gfx::SurfaceOrigin::kTopLeft;
|
||||
capabilities->supports_post_sub_buffer = false;
|
||||
capabilities->supports_commit_overlay_planes = false;
|
||||
capabilities->supports_surfaceless = true;
|
||||
|
||||
capabilities->sk_color_types[static_cast<int>(gfx::BufferFormat::RGBA_8888)] =
|
||||
kRGBA_8888_SkColorType;
|
||||
@ -384,8 +386,19 @@ void OutputPresenterFuchsia::SchedulePrimaryPlane(
|
||||
void OutputPresenterFuchsia::ScheduleOverlays(
|
||||
SkiaOutputSurface::OverlayList overlays,
|
||||
std::vector<ScopedOverlayAccess*> accesses) {
|
||||
// Overlays are not supported yet.
|
||||
NOTREACHED();
|
||||
for (auto& overlay : overlays) {
|
||||
DCHECK(overlay.mailbox.IsSharedImage());
|
||||
auto pixmap =
|
||||
dependency_->GetSharedImageManager()->GetNativePixmap(overlay.mailbox);
|
||||
if (!pixmap) {
|
||||
LOG(ERROR) << "Cannot access SysmemNativePixmap";
|
||||
continue;
|
||||
}
|
||||
pixmap->ScheduleOverlayPlane(
|
||||
dependency_->GetSurfaceHandle(), overlay.plane_z_order,
|
||||
overlay.transform, ToNearestRect(overlay.display_rect), overlay.uv_rect,
|
||||
!overlay.is_opaque, nullptr /* gpu_fence */);
|
||||
}
|
||||
}
|
||||
|
||||
void OutputPresenterFuchsia::PresentNextFrame() {
|
||||
|
@ -198,6 +198,8 @@ void SkiaOutputDeviceBufferQueue::ScheduleOverlays(
|
||||
SkiaOutputSurface::OverlayList overlays) {
|
||||
DCHECK(pending_overlay_mailboxes_.empty());
|
||||
std::vector<OutputPresenter::ScopedOverlayAccess*> accesses(overlays.size());
|
||||
// Fuchsia does not provide a GLImage overlay.
|
||||
#if !defined(OS_FUCHSIA)
|
||||
for (size_t i = 0; i < overlays.size(); ++i) {
|
||||
const auto& overlay = overlays[i];
|
||||
if (!overlay.mailbox.IsSharedImage())
|
||||
@ -246,6 +248,7 @@ void SkiaOutputDeviceBufferQueue::ScheduleOverlays(
|
||||
accesses[i] = it->scoped_read_access();
|
||||
pending_overlay_mailboxes_.emplace_back(overlay.mailbox);
|
||||
}
|
||||
#endif // defined(OS_FUCHSIA)
|
||||
|
||||
presenter_->ScheduleOverlays(std::move(overlays), std::move(accesses));
|
||||
}
|
||||
|
@ -584,6 +584,10 @@ void ExternalVkImageBacking::AddSemaphoresToPendingListOrRelease(
|
||||
}
|
||||
}
|
||||
|
||||
scoped_refptr<gfx::NativePixmap> ExternalVkImageBacking::GetNativePixmap() {
|
||||
return image_->native_pixmap();
|
||||
}
|
||||
|
||||
void ExternalVkImageBacking::ReturnPendingSemaphoresWithFenceHelper(
|
||||
std::vector<ExternalSemaphore> semaphores) {
|
||||
std::move(semaphores.begin(), semaphores.end(),
|
||||
|
@ -130,6 +130,7 @@ class ExternalVkImageBacking final : public ClearTrackingSharedImageBacking {
|
||||
// SharedImageBacking implementation.
|
||||
void Update(std::unique_ptr<gfx::GpuFence> in_fence) override;
|
||||
bool ProduceLegacyMailbox(MailboxManager* mailbox_manager) override;
|
||||
scoped_refptr<gfx::NativePixmap> GetNativePixmap() override;
|
||||
|
||||
// Add semaphores to a pending list for reusing or being released immediately.
|
||||
void AddSemaphoresToPendingListOrRelease(
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "gpu/ipc/common/vulkan_ycbcr_info.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/gfx/gpu_memory_buffer.h"
|
||||
#include "ui/gfx/native_pixmap.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/scoped_handle.h"
|
||||
@ -113,6 +114,12 @@ class COMPONENT_EXPORT(VULKAN) VulkanImage {
|
||||
VkImage image() const { return image_; }
|
||||
VkDeviceMemory device_memory() const { return device_memory_; }
|
||||
VkExternalMemoryHandleTypeFlags handle_types() const { return handle_types_; }
|
||||
void set_native_pixmap(scoped_refptr<gfx::NativePixmap> pixmap) {
|
||||
native_pixmap_ = std::move(pixmap);
|
||||
}
|
||||
const scoped_refptr<gfx::NativePixmap>& native_pixmap() const {
|
||||
return native_pixmap_;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Initialize(VulkanDeviceQueue* device_queue,
|
||||
@ -153,6 +160,7 @@ class COMPONENT_EXPORT(VULKAN) VulkanImage {
|
||||
VkImage image_ = VK_NULL_HANDLE;
|
||||
VkDeviceMemory device_memory_ = VK_NULL_HANDLE;
|
||||
VkExternalMemoryHandleTypeFlags handle_types_ = 0;
|
||||
scoped_refptr<gfx::NativePixmap> native_pixmap_;
|
||||
};
|
||||
|
||||
} // namespace gpu
|
||||
|
@ -12,6 +12,8 @@ source_set("scenic") {
|
||||
sources = [
|
||||
"client_native_pixmap_factory_scenic.cc",
|
||||
"client_native_pixmap_factory_scenic.h",
|
||||
"overlay_manager_scenic.cc",
|
||||
"overlay_manager_scenic.h",
|
||||
"ozone_platform_scenic.cc",
|
||||
"ozone_platform_scenic.h",
|
||||
"scenic_gpu_host.cc",
|
||||
@ -36,6 +38,8 @@ source_set("scenic") {
|
||||
"sysmem_buffer_collection.h",
|
||||
"sysmem_buffer_manager.cc",
|
||||
"sysmem_buffer_manager.h",
|
||||
"sysmem_native_pixmap.cc",
|
||||
"sysmem_native_pixmap.h",
|
||||
]
|
||||
|
||||
defines = [
|
||||
|
44
ui/ozone/platform/scenic/overlay_manager_scenic.cc
Normal file
44
ui/ozone/platform/scenic/overlay_manager_scenic.cc
Normal file
@ -0,0 +1,44 @@
|
||||
// Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ui/ozone/platform/scenic/overlay_manager_scenic.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "ui/ozone/platform/scenic/sysmem_native_pixmap.h"
|
||||
#include "ui/ozone/public/overlay_candidates_ozone.h"
|
||||
|
||||
namespace ui {
|
||||
namespace {
|
||||
|
||||
class OverlayCandidatesScenic : public OverlayCandidatesOzone {
|
||||
public:
|
||||
OverlayCandidatesScenic(gfx::AcceleratedWidget widget) : widget_(widget) {}
|
||||
|
||||
void CheckOverlaySupport(OverlaySurfaceCandidateList* candidates) override {
|
||||
for (auto& candidate : *candidates) {
|
||||
if (!candidate.native_pixmap)
|
||||
continue;
|
||||
SysmemNativePixmap* sysmem_native_pixmap =
|
||||
reinterpret_cast<SysmemNativePixmap*>(candidate.native_pixmap.get());
|
||||
candidate.overlay_handled =
|
||||
sysmem_native_pixmap->SupportsOverlayPlane(widget_);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const gfx::AcceleratedWidget widget_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
OverlayManagerScenic::OverlayManagerScenic() {}
|
||||
|
||||
OverlayManagerScenic::~OverlayManagerScenic() = default;
|
||||
|
||||
std::unique_ptr<OverlayCandidatesOzone>
|
||||
OverlayManagerScenic::CreateOverlayCandidates(gfx::AcceleratedWidget widget) {
|
||||
return std::make_unique<OverlayCandidatesScenic>(widget);
|
||||
}
|
||||
|
||||
} // namespace ui
|
29
ui/ozone/platform/scenic/overlay_manager_scenic.h
Normal file
29
ui/ozone/platform/scenic/overlay_manager_scenic.h
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef UI_OZONE_PLATFORM_SCENIC_OVERLAY_MANAGER_SCENIC_H_
|
||||
#define UI_OZONE_PLATFORM_SCENIC_OVERLAY_MANAGER_SCENIC_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ui/ozone/public/overlay_manager_ozone.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class OverlayManagerScenic : public OverlayManagerOzone {
|
||||
public:
|
||||
OverlayManagerScenic();
|
||||
~OverlayManagerScenic() override;
|
||||
|
||||
OverlayManagerScenic(const OverlayManagerScenic&) = delete;
|
||||
OverlayManagerScenic& operator=(const OverlayManagerScenic&) = delete;
|
||||
|
||||
// OverlayManagerOzone implementation
|
||||
std::unique_ptr<OverlayCandidatesOzone> CreateOverlayCandidates(
|
||||
gfx::AcceleratedWidget widget) override;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_OZONE_PLATFORM_SCENIC_OVERLAY_MANAGER_SCENIC_H_
|
@ -25,6 +25,7 @@
|
||||
#include "ui/events/platform/platform_event_source.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
#include "ui/ozone/common/stub_overlay_manager.h"
|
||||
#include "ui/ozone/platform/scenic/overlay_manager_scenic.h"
|
||||
#include "ui/ozone/platform/scenic/scenic_gpu_host.h"
|
||||
#include "ui/ozone/platform/scenic/scenic_gpu_service.h"
|
||||
#include "ui/ozone/platform/scenic/scenic_surface_factory.h"
|
||||
@ -164,6 +165,8 @@ class OzonePlatformScenic : public OzonePlatform,
|
||||
// other end of the pipe will be attached through ScenicGpuService.
|
||||
surface_factory_->Initialize(std::move(scenic_gpu_host_remote));
|
||||
}
|
||||
|
||||
overlay_manager_ = std::make_unique<OverlayManagerScenic>();
|
||||
}
|
||||
|
||||
void AddInterfaces(mojo::BinderMap* binders) override {
|
||||
|
@ -9,75 +9,13 @@
|
||||
#include "gpu/vulkan/vulkan_device_queue.h"
|
||||
#include "gpu/vulkan/vulkan_function_pointers.h"
|
||||
#include "ui/gfx/buffer_format_util.h"
|
||||
#include "ui/gfx/native_pixmap.h"
|
||||
#include "ui/ozone/platform/scenic/scenic_surface_factory.h"
|
||||
#include "ui/ozone/platform/scenic/sysmem_native_pixmap.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
namespace {
|
||||
|
||||
class SysmemNativePixmap : public gfx::NativePixmap {
|
||||
public:
|
||||
SysmemNativePixmap(scoped_refptr<SysmemBufferCollection> collection,
|
||||
gfx::NativePixmapHandle handle)
|
||||
: collection_(collection), handle_(std::move(handle)) {}
|
||||
|
||||
bool AreDmaBufFdsValid() const override { return false; }
|
||||
int GetDmaBufFd(size_t plane) const override {
|
||||
NOTREACHED();
|
||||
return -1;
|
||||
}
|
||||
uint32_t GetDmaBufPitch(size_t plane) const override {
|
||||
NOTREACHED();
|
||||
return 0u;
|
||||
}
|
||||
size_t GetDmaBufOffset(size_t plane) const override {
|
||||
NOTREACHED();
|
||||
return 0u;
|
||||
}
|
||||
size_t GetDmaBufPlaneSize(size_t plane) const override {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
size_t GetNumberOfPlanes() const override {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
uint64_t GetBufferFormatModifier() const override {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
gfx::BufferFormat GetBufferFormat() const override {
|
||||
return collection_->format();
|
||||
}
|
||||
gfx::Size GetBufferSize() const override { return collection_->size(); }
|
||||
uint32_t GetUniqueId() const override { return 0; }
|
||||
bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
|
||||
int plane_z_order,
|
||||
gfx::OverlayTransform plane_transform,
|
||||
const gfx::Rect& display_bounds,
|
||||
const gfx::RectF& crop_rect,
|
||||
bool enable_blend,
|
||||
std::unique_ptr<gfx::GpuFence> gpu_fence) override {
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return false;
|
||||
}
|
||||
gfx::NativePixmapHandle ExportHandle() override {
|
||||
return gfx::CloneHandleForIPC(handle_);
|
||||
}
|
||||
|
||||
private:
|
||||
~SysmemNativePixmap() override = default;
|
||||
|
||||
// Keep reference to the collection to make sure it outlives the pixmap.
|
||||
scoped_refptr<SysmemBufferCollection> collection_;
|
||||
gfx::NativePixmapHandle handle_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SysmemNativePixmap);
|
||||
};
|
||||
|
||||
size_t RoundUp(size_t value, size_t alignment) {
|
||||
return ((value + alignment - 1) / alignment) * alignment;
|
||||
}
|
||||
|
@ -87,6 +87,10 @@ class SysmemBufferCollection
|
||||
size_t buffer_size() const {
|
||||
return buffers_info_.settings.buffer_settings.size_bytes;
|
||||
}
|
||||
ScenicOverlayView* scenic_overlay_view() {
|
||||
return scenic_overlay_view_.has_value() ? &scenic_overlay_view_.value()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class base::RefCountedThreadSafe<SysmemBufferCollection>;
|
||||
|
87
ui/ozone/platform/scenic/sysmem_native_pixmap.cc
Normal file
87
ui/ozone/platform/scenic/sysmem_native_pixmap.cc
Normal file
@ -0,0 +1,87 @@
|
||||
// Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ui/ozone/platform/scenic/sysmem_native_pixmap.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
SysmemNativePixmap::SysmemNativePixmap(
|
||||
scoped_refptr<SysmemBufferCollection> collection,
|
||||
gfx::NativePixmapHandle handle)
|
||||
: collection_(collection), handle_(std::move(handle)) {}
|
||||
|
||||
SysmemNativePixmap::~SysmemNativePixmap() = default;
|
||||
|
||||
bool SysmemNativePixmap::AreDmaBufFdsValid() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
int SysmemNativePixmap::GetDmaBufFd(size_t plane) const {
|
||||
NOTREACHED();
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint32_t SysmemNativePixmap::GetDmaBufPitch(size_t plane) const {
|
||||
NOTREACHED();
|
||||
return 0u;
|
||||
}
|
||||
|
||||
size_t SysmemNativePixmap::GetDmaBufOffset(size_t plane) const {
|
||||
NOTREACHED();
|
||||
return 0u;
|
||||
}
|
||||
|
||||
size_t SysmemNativePixmap::GetDmaBufPlaneSize(size_t plane) const {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t SysmemNativePixmap::GetNumberOfPlanes() const {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t SysmemNativePixmap::GetBufferFormatModifier() const {
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
gfx::BufferFormat SysmemNativePixmap::GetBufferFormat() const {
|
||||
return collection_->format();
|
||||
}
|
||||
|
||||
gfx::Size SysmemNativePixmap::GetBufferSize() const {
|
||||
return collection_->size();
|
||||
}
|
||||
|
||||
uint32_t SysmemNativePixmap::GetUniqueId() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SysmemNativePixmap::ScheduleOverlayPlane(
|
||||
gfx::AcceleratedWidget widget,
|
||||
int plane_z_order,
|
||||
gfx::OverlayTransform plane_transform,
|
||||
const gfx::Rect& display_bounds,
|
||||
const gfx::RectF& crop_rect,
|
||||
bool enable_blend,
|
||||
std::unique_ptr<gfx::GpuFence> gpu_fence) {
|
||||
DCHECK(collection_->scenic_overlay_view());
|
||||
// TODO(crbug.com/1127984): Present to ScenicOverlayView's ImagePipe. Send
|
||||
// ScenicOverlayView's viewholder to the ScenicSurface associated with
|
||||
// |widget|.
|
||||
NOTIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
gfx::NativePixmapHandle SysmemNativePixmap::ExportHandle() {
|
||||
return gfx::CloneHandleForIPC(handle_);
|
||||
}
|
||||
|
||||
bool SysmemNativePixmap::SupportsOverlayPlane(
|
||||
gfx::AcceleratedWidget widget) const {
|
||||
return collection_->scenic_overlay_view();
|
||||
}
|
||||
|
||||
} // namespace ui
|
55
ui/ozone/platform/scenic/sysmem_native_pixmap.h
Normal file
55
ui/ozone/platform/scenic/sysmem_native_pixmap.h
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef UI_OZONE_PLATFORM_SCENIC_SYSMEM_NATIVE_PIXMAP_H_
|
||||
#define UI_OZONE_PLATFORM_SCENIC_SYSMEM_NATIVE_PIXMAP_H_
|
||||
|
||||
#include "ui/gfx/native_pixmap.h"
|
||||
#include "ui/ozone/platform/scenic/sysmem_buffer_collection.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class SysmemNativePixmap : public gfx::NativePixmap {
|
||||
public:
|
||||
SysmemNativePixmap(scoped_refptr<SysmemBufferCollection> collection,
|
||||
gfx::NativePixmapHandle handle);
|
||||
|
||||
SysmemNativePixmap(const SysmemNativePixmap&) = delete;
|
||||
SysmemNativePixmap& operator=(const SysmemNativePixmap&) = delete;
|
||||
|
||||
// gfx::NativePixmap implementation.
|
||||
bool AreDmaBufFdsValid() const override;
|
||||
int GetDmaBufFd(size_t plane) const override;
|
||||
uint32_t GetDmaBufPitch(size_t plane) const override;
|
||||
size_t GetDmaBufOffset(size_t plane) const override;
|
||||
size_t GetDmaBufPlaneSize(size_t plane) const override;
|
||||
size_t GetNumberOfPlanes() const override;
|
||||
uint64_t GetBufferFormatModifier() const override;
|
||||
gfx::BufferFormat GetBufferFormat() const override;
|
||||
gfx::Size GetBufferSize() const override;
|
||||
uint32_t GetUniqueId() const override;
|
||||
bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
|
||||
int plane_z_order,
|
||||
gfx::OverlayTransform plane_transform,
|
||||
const gfx::Rect& display_bounds,
|
||||
const gfx::RectF& crop_rect,
|
||||
bool enable_blend,
|
||||
std::unique_ptr<gfx::GpuFence> gpu_fence) override;
|
||||
gfx::NativePixmapHandle ExportHandle() override;
|
||||
|
||||
// Returns true if overlay planes are supported and ScheduleOverlayPlane() can
|
||||
// be called.
|
||||
bool SupportsOverlayPlane(gfx::AcceleratedWidget widget) const;
|
||||
|
||||
private:
|
||||
~SysmemNativePixmap() override;
|
||||
|
||||
// Keep reference to the collection to make sure it outlives the pixmap.
|
||||
scoped_refptr<SysmemBufferCollection> collection_;
|
||||
gfx::NativePixmapHandle handle_;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_OZONE_PLATFORM_SCENIC_SYSMEM_NATIVE_PIXMAP_H_
|
@ -278,6 +278,8 @@ VulkanImplementationScenic::CreateImageFromGpuMemoryHandle(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
image->set_native_pixmap(collection->CreateNativePixmap(
|
||||
gmb_handle.native_pixmap_handle.buffer_index));
|
||||
return image;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user