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/common/drm_util.h" | 5 #include "ui/ozone/platform/drm/common/drm_util.h" |
6 | 6 |
7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 return params; | 271 return params; |
272 } | 272 } |
273 | 273 |
274 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) { | 274 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) { |
275 switch (format) { | 275 switch (format) { |
276 case gfx::BufferFormat::BGRA_8888: | 276 case gfx::BufferFormat::BGRA_8888: |
277 return DRM_FORMAT_ARGB8888; | 277 return DRM_FORMAT_ARGB8888; |
278 case gfx::BufferFormat::BGRX_8888: | 278 case gfx::BufferFormat::BGRX_8888: |
279 return DRM_FORMAT_XRGB8888; | 279 return DRM_FORMAT_XRGB8888; |
| 280 case gfx::BufferFormat::UYVY_422: |
| 281 return DRM_FORMAT_UYVY; |
280 default: | 282 default: |
281 NOTREACHED(); | 283 NOTREACHED(); |
282 return 0; | 284 return 0; |
283 } | 285 } |
284 } | 286 } |
285 | 287 |
| 288 gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) { |
| 289 switch (format) { |
| 290 case DRM_FORMAT_ARGB8888: |
| 291 return gfx::BufferFormat::BGRA_8888; |
| 292 case DRM_FORMAT_XRGB8888: |
| 293 return gfx::BufferFormat::BGRX_8888; |
| 294 case DRM_FORMAT_UYVY: |
| 295 return gfx::BufferFormat::UYVY_422; |
| 296 default: |
| 297 NOTREACHED(); |
| 298 return gfx::BufferFormat::LAST; |
| 299 } |
| 300 } |
286 } // namespace ui | 301 } // namespace ui |
OLD | NEW |