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::RGBA_8888, size, | 82 return GbmBuffer::CreateBuffer(gbm, SurfaceFactoryOzone::BGRA_8888, size); |
83 true); | |
84 } | 83 } |
85 | 84 |
86 protected: | 85 protected: |
87 DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator); | 86 DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator); |
88 }; | 87 }; |
89 | 88 |
90 class GbmDeviceGenerator : public DrmDeviceGenerator { | 89 class GbmDeviceGenerator : public DrmDeviceGenerator { |
91 public: | 90 public: |
92 GbmDeviceGenerator() {} | 91 GbmDeviceGenerator() {} |
93 ~GbmDeviceGenerator() override {} | 92 ~GbmDeviceGenerator() override {} |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 OzonePlatform* CreateOzonePlatformGbm() { | 234 OzonePlatform* CreateOzonePlatformGbm() { |
236 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 235 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
237 #if defined(USE_MESA_PLATFORM_NULL) | 236 #if defined(USE_MESA_PLATFORM_NULL) |
238 // Only works with surfaceless. | 237 // Only works with surfaceless. |
239 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); | 238 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); |
240 #endif | 239 #endif |
241 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 240 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
242 } | 241 } |
243 | 242 |
244 } // namespace ui | 243 } // namespace ui |
OLD | NEW |