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

Side by Side 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: fix cast build 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/cast/surface_factory_cast.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.h" 5 #include "ui/ozone/platform/drm/common/client_native_pixmap_factory_gbm.h"
6 6
7 #include "base/file_descriptor_posix.h" 7 #include "base/file_descriptor_posix.h"
8 #include "ui/gfx/native_pixmap_handle_ozone.h"
8 #include "ui/ozone/public/client_native_pixmap_factory.h" 9 #include "ui/ozone/public/client_native_pixmap_factory.h"
9 10
10 namespace ui { 11 namespace ui {
11 12
12 namespace { 13 namespace {
13 14
15 class ClientNativePixmapGbm : public ClientNativePixmap {
16 public:
17 ClientNativePixmapGbm() {}
18 ~ClientNativePixmapGbm() override {}
19
20 bool Map(void** data) override {
21 NOTREACHED();
22 return false;
23 }
24 void Unmap() override { NOTREACHED(); }
25 void GetStride(int* stride) const override { NOTREACHED(); }
26 };
27
14 class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory { 28 class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
15 public: 29 public:
16 ClientNativePixmapFactoryGbm() {} 30 ClientNativePixmapFactoryGbm() {}
17 ~ClientNativePixmapFactoryGbm() override {} 31 ~ClientNativePixmapFactoryGbm() override {}
18 32
19 // ClientNativePixmapFactory: 33 // ClientNativePixmapFactory:
20 std::vector<Configuration> GetSupportedConfigurations() const override { 34 std::vector<Configuration> GetSupportedConfigurations() const override {
21 const Configuration kConfiguratioins[] = { 35 const Configuration kConfigurations[] = {
22 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, 36 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT},
23 {gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT}}; 37 {gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT}};
24 std::vector<Configuration> configurations( 38 std::vector<Configuration> configurations(
25 kConfiguratioins, kConfiguratioins + arraysize(kConfiguratioins)); 39 kConfigurations, kConfigurations + arraysize(kConfigurations));
26 return configurations; 40 return configurations;
27 } 41 }
28 scoped_ptr<ClientNativePixmap> ImportNativePixmap( 42 scoped_ptr<ClientNativePixmap> ImportFromHandle(
29 const base::FileDescriptor& handle, 43 const gfx::NativePixmapHandle& handle,
30 const gfx::Size& size, 44 const gfx::Size& size,
31 gfx::BufferFormat format, 45 gfx::BufferFormat format,
32 gfx::BufferUsage usage) override { 46 gfx::BufferUsage usage) override {
33 NOTIMPLEMENTED(); 47 base::ScopedFD scoped_fd(handle.fd.fd);
34 return nullptr; 48 return make_scoped_ptr<ClientNativePixmapGbm>(new ClientNativePixmapGbm);
35 } 49 }
36 50
37 private: 51 private:
38 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm); 52 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm);
39 }; 53 };
40 54
41 } // namespace 55 } // namespace
42 56
43 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() { 57 ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() {
44 return new ClientNativePixmapFactoryGbm(); 58 return new ClientNativePixmapFactoryGbm();
45 } 59 }
46 60
47 } // namespace ui 61 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/cast/surface_factory_cast.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698