Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: ui/ozone/platform/drm/gpu/gbm_buffer.cc

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.h ('k') | ui/ozone/platform/headless/headless_surface_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_buffer.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index a7b74d18ce091950a10ed4ff8a61c80c7254f243..b18238e893c6d21834add54e6d4a862013579af5 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -19,6 +19,8 @@
#include "ui/ozone/platform/drm/gpu/gbm_device.h"
#include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
#include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
+#include "ui/ozone/public/ozone_platform.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
namespace {
// Optimal format for rendering on overlay.
@@ -93,7 +95,21 @@ void GbmPixmap::SetProcessingCallback(
scoped_refptr<NativePixmap> GbmPixmap::GetProcessedPixmap(
gfx::Size target_size,
gfx::BufferFormat target_format) {
- return processing_callback_.Run(target_size, target_format);
+ ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
+ ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
+ // Create a buffer from Ozone.
+ scoped_refptr<ui::NativePixmap> processed_pixmap =
+ factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, target_size,
+ target_format, gfx::BufferUsage::SCANOUT);
+ if (!processed_pixmap) {
+ LOG(ERROR) << "Failed creating an Ozone NativePixmap for processing";
+ return nullptr;
+ }
+ if (!processing_callback_.Run(this, processed_pixmap)) {
+ LOG(ERROR) << "Failed processing NativePixmap";
+ return nullptr;
+ }
+ return processed_pixmap;
}
gfx::NativePixmapHandle GbmPixmap::ExportHandle() {
@@ -129,6 +145,10 @@ gfx::BufferFormat GbmPixmap::GetBufferFormat() const {
return GetBufferFormatFromFourCCFormat(buffer_->GetFramebufferPixelFormat());
}
+gfx::Size GbmPixmap::GetBufferSize() const {
+ return buffer_->GetSize();
+}
+
bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int plane_z_order,
gfx::OverlayTransform plane_transform,
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.h ('k') | ui/ozone/platform/headless/headless_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698