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

Side by Side Diff: gpu/gles2_conform_support/egl/egl.cc

Issue 1220883008: Add command_buffer_gles2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments to build files Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <EGL/egl.h> 5 #include <EGL/egl.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "gpu/command_buffer/client/gles2_lib.h" 8 #include "gpu/command_buffer/client/gles2_lib.h"
9 #include "gpu/gles2_conform_support/egl/display.h" 9 #include "gpu/gles2_conform_support/egl/display.h"
10 #include "ui/gl/gl_context.h" 10 #include "ui/gl/gl_context.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) { 97 EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) {
98 if (dpy == EGL_NO_DISPLAY) 98 if (dpy == EGL_NO_DISPLAY)
99 return EglError(EGL_BAD_DISPLAY, EGL_FALSE); 99 return EglError(EGL_BAD_DISPLAY, EGL_FALSE);
100 100
101 egl::Display* display = static_cast<egl::Display*>(dpy); 101 egl::Display* display = static_cast<egl::Display*>(dpy);
102 if (!display->Initialize()) 102 if (!display->Initialize())
103 return EglError(EGL_NOT_INITIALIZED, EGL_FALSE); 103 return EglError(EGL_NOT_INITIALIZED, EGL_FALSE);
104 104
105 int argc = 1; 105 // eglInitialize can be called multiple times, prevent InitializeOneOff from
106 const char* const argv[] = { 106 // being called multiple times.
107 "dummy" 107 if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) {
no sievers 2015/08/28 18:39:33 I think you can just run this code every time if y
108 }; 108 int argc = 1;
109 base::CommandLine::Init(argc, argv); 109 const char* const argv[] = {
110 gfx::GLSurface::InitializeOneOff(); 110 "dummy"
111 };
112 base::CommandLine::Init(argc, argv);
113 gfx::GLSurface::InitializeOneOff();
114 }
111 115
112 *major = 1; 116 *major = 1;
113 *minor = 4; 117 *minor = 4;
114 return EglSuccess(EGL_TRUE); 118 return EglSuccess(EGL_TRUE);
115 } 119 }
116 120
117 EGLBoolean eglTerminate(EGLDisplay dpy) { 121 EGLBoolean eglTerminate(EGLDisplay dpy) {
118 EGLint error_code = ValidateDisplay(dpy); 122 EGLint error_code = ValidateDisplay(dpy);
119 if (error_code != EGL_SUCCESS) 123 if (error_code != EGL_SUCCESS)
120 return EglError(error_code, EGL_FALSE); 124 return EglError(error_code, EGL_FALSE);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 return EGL_FALSE; 425 return EGL_FALSE;
422 } 426 }
423 427
424 /* Now, define eglGetProcAddress using the generic function ptr. type */ 428 /* Now, define eglGetProcAddress using the generic function ptr. type */
425 __eglMustCastToProperFunctionPointerType 429 __eglMustCastToProperFunctionPointerType
426 eglGetProcAddress(const char* procname) { 430 eglGetProcAddress(const char* procname) {
427 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( 431 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>(
428 gles2::GetGLFunctionPointer(procname)); 432 gles2::GetGLFunctionPointer(procname));
429 } 433 }
430 } // extern "C" 434 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698