OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <gbm.h> | 8 #include <gbm.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 class GbmBufferGenerator : public ScanoutBufferGenerator { | 73 class GbmBufferGenerator : public ScanoutBufferGenerator { |
74 public: | 74 public: |
75 GbmBufferGenerator() {} | 75 GbmBufferGenerator() {} |
76 ~GbmBufferGenerator() override {} | 76 ~GbmBufferGenerator() override {} |
77 | 77 |
78 // ScanoutBufferGenerator: | 78 // ScanoutBufferGenerator: |
79 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm, | 79 scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm, |
80 const gfx::Size& size) override { | 80 const gfx::Size& size) override { |
81 scoped_refptr<GbmDevice> gbm(static_cast<GbmDevice*>(drm.get())); | 81 scoped_refptr<GbmDevice> gbm(static_cast<GbmDevice*>(drm.get())); |
82 return GbmBuffer::CreateBuffer(gbm, SurfaceFactoryOzone::BGRA_8888, size, | 82 return GbmBuffer::CreateBuffer(gbm, gfx::BufferFormat::BGRA_8888, size, |
83 SurfaceFactoryOzone::SCANOUT); | 83 gfx::BufferUsage::SCANOUT); |
84 } | 84 } |
85 | 85 |
86 protected: | 86 protected: |
87 DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator); | 87 DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator); |
88 }; | 88 }; |
89 | 89 |
90 class GbmDeviceGenerator : public DrmDeviceGenerator { | 90 class GbmDeviceGenerator : public DrmDeviceGenerator { |
91 public: | 91 public: |
92 GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {} | 92 GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {} |
93 ~GbmDeviceGenerator() override {} | 93 ~GbmDeviceGenerator() override {} |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 OzonePlatform* CreateOzonePlatformGbm() { | 224 OzonePlatform* CreateOzonePlatformGbm() { |
225 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 225 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
226 #if defined(USE_MESA_PLATFORM_NULL) | 226 #if defined(USE_MESA_PLATFORM_NULL) |
227 // Only works with surfaceless. | 227 // Only works with surfaceless. |
228 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); | 228 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); |
229 #endif | 229 #endif |
230 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 230 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
231 } | 231 } |
232 | 232 |
233 } // namespace ui | 233 } // namespace ui |
OLD | NEW |