OLD | NEW |
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/gfx/buffer_format_util.h" | 5 #include "ui/gfx/buffer_format_util.h" |
| 6 #include "ui/gl/gl_fence.h" |
6 #include "ui/gl/gl_image_ozone_native_pixmap.h" | 7 #include "ui/gl/gl_image_ozone_native_pixmap.h" |
7 | 8 |
8 #define FOURCC(a, b, c, d) \ | 9 #define FOURCC(a, b, c, d) \ |
9 ((static_cast<uint32_t>(a)) | (static_cast<uint32_t>(b) << 8) | \ | 10 ((static_cast<uint32_t>(a)) | (static_cast<uint32_t>(b) << 8) | \ |
10 (static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24)) | 11 (static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24)) |
11 | 12 |
12 #define DRM_FORMAT_R8 FOURCC('R', '8', ' ', ' ') | 13 #define DRM_FORMAT_R8 FOURCC('R', '8', ' ', ' ') |
13 #define DRM_FORMAT_RGB565 FOURCC('R', 'G', '1', '6') | 14 #define DRM_FORMAT_RGB565 FOURCC('R', 'G', '1', '6') |
14 #define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4') | 15 #define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4') |
15 #define DRM_FORMAT_ABGR8888 FOURCC('A', 'B', '2', '4') | 16 #define DRM_FORMAT_ABGR8888 FOURCC('A', 'B', '2', '4') |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 case gfx::BufferFormat::YUV_420_BIPLANAR: | 236 case gfx::BufferFormat::YUV_420_BIPLANAR: |
236 case gfx::BufferFormat::UYVY_422: | 237 case gfx::BufferFormat::UYVY_422: |
237 NOTREACHED(); | 238 NOTREACHED(); |
238 return GL_NONE; | 239 return GL_NONE; |
239 } | 240 } |
240 | 241 |
241 NOTREACHED(); | 242 NOTREACHED(); |
242 return GL_NONE; | 243 return GL_NONE; |
243 } | 244 } |
244 | 245 |
| 246 void GLImageOzoneNativePixmap::Flush() { |
| 247 const EGLint attribs[] = {EGL_IMAGE_EXTERNAL_TARGET_NVX, EGL_DECOMPRESSED_NVX, |
| 248 EGL_NONE}; |
| 249 |
| 250 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
| 251 if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) { |
| 252 LOG(ERROR) << "Failed to flush rendering"; |
| 253 return; |
| 254 } |
| 255 |
| 256 GLFence* fence = GLFence::Create(); |
| 257 fence->ClientWait(); |
| 258 delete fence; |
| 259 } |
| 260 |
245 } // namespace gl | 261 } // namespace gl |
OLD | NEW |