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 EGLAttrib attribs[] = {EGL_IMAGE_EXTERNAL_TARGET_NVX, | |
248 EGL_DECOMPRESSED_NVX, EGL_NONE}; | |
249 | |
250 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); | |
dnicoara
2016/06/29 14:21:56
I believe you should be using "GLSurfaceEGL::GetHa
vinceh
2016/06/30 09:22:48
OK, will fix.
| |
251 if (!eglImageFlushExternalEXT(display, egl_image_, attribs)) { | |
piman
2016/06/29 17:34:50
What if the extension is not supported?
vinceh
2016/06/30 09:22:48
I should add check for the extension. Thanks.
| |
252 LOG(ERROR) << "Failed to flush rendering"; | |
253 return; | |
254 } | |
255 | |
256 GLFence* fence = GLFence::Create(); | |
piman
2016/06/29 17:34:50
nit: use std::unique_ptr<GLFence>
| |
257 fence->ClientWait(); | |
piman
2016/06/29 17:34:50
So, you're doing this on all drivers, even though
vinceh
2016/06/30 09:22:48
I should do this only when the extension is suppor
piman
2016/06/30 18:18:58
Commented there. I think this should integrate wit
| |
258 delete fence; | |
259 } | |
260 | |
245 } // namespace gl | 261 } // namespace gl |
OLD | NEW |