Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: gpu/command_buffer/service/texture_definition.cc

Issue 331293003: Add common GLFence::IsSupported() check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "gpu/command_buffer/service/texture_definition.h" 5 #include "gpu/command_buffer/service/texture_definition.h"
6 6
7 #include "gpu/command_buffer/service/texture_manager.h" 7 #include "gpu/command_buffer/service/texture_manager.h"
8 #include "ui/gl/gl_image.h" 8 #include "ui/gl/gl_image.h"
9 #include "ui/gl/gl_implementation.h" 9 #include "ui/gl/gl_implementation.h"
10 #include "ui/gl/scoped_binders.h" 10 #include "ui/gl/scoped_binders.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EGLDisplay egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay(); 118 EGLDisplay egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay();
119 EGLContext egl_context = eglGetCurrentContext(); 119 EGLContext egl_context = eglGetCurrentContext();
120 120
121 DCHECK_NE(EGL_NO_CONTEXT, egl_context); 121 DCHECK_NE(EGL_NO_CONTEXT, egl_context);
122 DCHECK_NE(EGL_NO_DISPLAY, egl_display); 122 DCHECK_NE(EGL_NO_DISPLAY, egl_display);
123 DCHECK(glIsTexture(texture_id)); 123 DCHECK(glIsTexture(texture_id));
124 124
125 DCHECK(gfx::g_driver_egl.ext.b_EGL_KHR_image_base && 125 DCHECK(gfx::g_driver_egl.ext.b_EGL_KHR_image_base &&
126 gfx::g_driver_egl.ext.b_EGL_KHR_gl_texture_2D_image && 126 gfx::g_driver_egl.ext.b_EGL_KHR_gl_texture_2D_image &&
127 gfx::g_driver_gl.ext.b_GL_OES_EGL_image && 127 gfx::g_driver_gl.ext.b_GL_OES_EGL_image &&
128 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync); 128 gfx::GLFence::IsSupported());
129 129
130 const EGLint egl_attrib_list[] = { 130 const EGLint egl_attrib_list[] = {
131 EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; 131 EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE};
132 EGLClientBuffer egl_buffer = reinterpret_cast<EGLClientBuffer>(texture_id); 132 EGLClientBuffer egl_buffer = reinterpret_cast<EGLClientBuffer>(texture_id);
133 EGLenum egl_target = EGL_GL_TEXTURE_2D_KHR; // TODO 133 EGLenum egl_target = EGL_GL_TEXTURE_2D_KHR; // TODO
134 134
135 EGLImageKHR egl_image = eglCreateImageKHR( 135 EGLImageKHR egl_image = eglCreateImageKHR(
136 egl_display, egl_context, egl_target, egl_buffer, egl_attrib_list); 136 egl_display, egl_context, egl_target, egl_buffer, egl_attrib_list);
137 137
138 if (egl_image == EGL_NO_IMAGE_KHR) 138 if (egl_image == EGL_NO_IMAGE_KHR)
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 437
438 // All structural changes should have orphaned the texture. 438 // All structural changes should have orphaned the texture.
439 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0)) 439 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0))
440 return false; 440 return false;
441 441
442 return true; 442 return true;
443 } 443 }
444 444
445 } // namespace gles2 445 } // namespace gles2
446 } // namespace gpu 446 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698