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

Side by Side Diff: core/cross/gles2/renderer_gles2.cc

Issue 3050038: o3d: create a gles v2 context for the native gles2 backend (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 DLOG(INFO) << "Depth: " << depth_size << " bits, Stencil:" << stencil_size 1198 DLOG(INFO) << "Depth: " << depth_size << " bits, Stencil:" << stencil_size
1199 << "bits"; 1199 << "bits";
1200 1200
1201 EGLSurface egl_surface = eglCreateWindowSurface(egl_display, config, 1201 EGLSurface egl_surface = eglCreateWindowSurface(egl_display, config,
1202 window, NULL); 1202 window, NULL);
1203 if (!egl_surface) { 1203 if (!egl_surface) {
1204 DLOG(ERROR) << "eglCreateWindowSurface failed."; 1204 DLOG(ERROR) << "eglCreateWindowSurface failed.";
1205 return INITIALIZATION_ERROR; 1205 return INITIALIZATION_ERROR;
1206 } 1206 }
1207 1207
1208 EGLContext egl_context = eglCreateContext(egl_display, config, NULL, NULL); 1208 static const EGLint egl_context_attributes[] = {
1209 EGL_CONTEXT_CLIENT_VERSION, 2,
1210 EGL_NONE
1211 };
1212
1213 EGLContext egl_context = eglCreateContext(egl_display, config, NULL,
1214 egl_context_attributes);
1209 if (!egl_context) { 1215 if (!egl_context) {
1210 DLOG(ERROR) << "eglCreateContext failed."; 1216 DLOG(ERROR) << "eglCreateContext failed.";
1211 eglDestroySurface(egl_display, egl_surface); 1217 eglDestroySurface(egl_display, egl_surface);
1212 return INITIALIZATION_ERROR; 1218 return INITIALIZATION_ERROR;
1213 } 1219 }
1214 1220
1215 display_ = display; 1221 display_ = display;
1216 window_ = window; 1222 window_ = window;
1217 egl_display_ = egl_display; 1223 egl_display_ = egl_display;
1218 egl_surface_ = egl_surface; 1224 egl_surface_ = egl_surface;
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 return swizzle_table; 1770 return swizzle_table;
1765 } 1771 }
1766 1772
1767 // This is a factory function for creating Renderer objects. Since 1773 // This is a factory function for creating Renderer objects. Since
1768 // we're implementing GLES2, we only ever return a GLES2 renderer. 1774 // we're implementing GLES2, we only ever return a GLES2 renderer.
1769 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { 1775 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) {
1770 return RendererGLES2::CreateDefault(service_locator); 1776 return RendererGLES2::CreateDefault(service_locator);
1771 } 1777 }
1772 1778
1773 } // namespace o3d 1779 } // namespace o3d
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698