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

Unified Diff: ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc

Issue 1263323004: Add NativePixmapHandle type & interface for exporting them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK on import failure Created 5 years, 4 months 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
Index: ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
diff --git a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
index ca150e5d56c78d153ab489185dd7716d85758f91..34a941da3ed824f35ffc0ebaa78fb85b1cbab567 100644
--- a/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
+++ b/ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.cc
@@ -5,12 +5,26 @@
#include "ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.h"
#include "base/file_descriptor_posix.h"
+#include "ui/gfx/native_pixmap_handle_ozone.h"
#include "ui/ozone/public/client_native_pixmap_factory.h"
namespace ui {
namespace {
+class ClientNativePixmapGbm : public ClientNativePixmap {
+ public:
+ ClientNativePixmapGbm() {}
+ ~ClientNativePixmapGbm() override {}
+
+ bool Map(void** data) override {
+ NOTREACHED();
+ return false;
+ }
+ void Unmap() override { NOTREACHED(); }
+ void GetStride(int* stride) const override { NOTREACHED(); }
+};
+
class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
public:
ClientNativePixmapFactoryGbm() {}
@@ -18,20 +32,20 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
// ClientNativePixmapFactory:
std::vector<Configuration> GetSupportedConfigurations() const override {
- const Configuration kConfiguratioins[] = {
+ const Configuration kConfigurations[] = {
{gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT},
{gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT}};
std::vector<Configuration> configurations(
- kConfiguratioins, kConfiguratioins + arraysize(kConfiguratioins));
+ kConfigurations, kConfigurations + arraysize(kConfigurations));
return configurations;
}
- scoped_ptr<ClientNativePixmap> ImportNativePixmap(
- const base::FileDescriptor& handle,
+ scoped_ptr<ClientNativePixmap> ImportFromHandle(
+ const gfx::NativePixmapHandle& handle,
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage) override {
- NOTIMPLEMENTED();
- return nullptr;
+ base::ScopedFD scoped_fd(handle.fd.fd);
dcheng 2015/08/18 18:43:25 Is this getting invoked in response to an IPC? ba
spang 2015/08/18 19:15:17 Right, we are required to take ownership. Putting
+ return make_scoped_ptr<ClientNativePixmapGbm>(new ClientNativePixmapGbm);
dcheng 2015/08/18 18:43:26 Nit: make_scoped_ptr(new ClientNativePixmapGbm) A
spang 2015/08/18 19:15:17 See the next patch for non-stub implementation: ht
}
private:

Powered by Google App Engine
This is Rietveld 408576698