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

Side by Side Diff: ui/gfx/gl/gl_context_egl.cc

Issue 8233027: Support dynamic switching between integrated and discrete GPUs on Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « ui/gfx/gl/gl_context_egl.h ('k') | ui/gfx/gl/gl_context_glx.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gl/gl_context_egl.h" 5 #include "ui/gfx/gl/gl_context_egl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/angle/include/EGL/egl.h" 10 #include "third_party/angle/include/EGL/egl.h"
(...skipping 24 matching lines...) Expand all
35 GLContextEGL::GLContextEGL(GLShareGroup* share_group) 35 GLContextEGL::GLContextEGL(GLShareGroup* share_group)
36 : GLContext(share_group), 36 : GLContext(share_group),
37 context_(NULL) 37 context_(NULL)
38 { 38 {
39 } 39 }
40 40
41 GLContextEGL::~GLContextEGL() { 41 GLContextEGL::~GLContextEGL() {
42 Destroy(); 42 Destroy();
43 } 43 }
44 44
45 bool GLContextEGL::Initialize(GLSurface* compatible_surface) { 45 bool GLContextEGL::Initialize(
46 GLSurface* compatible_surface, GpuPreference gpu_preference) {
46 DCHECK(compatible_surface); 47 DCHECK(compatible_surface);
47 DCHECK(!context_); 48 DCHECK(!context_);
48 49
49 static const EGLint kContextAttributes[] = { 50 static const EGLint kContextAttributes[] = {
50 EGL_CONTEXT_CLIENT_VERSION, 2, 51 EGL_CONTEXT_CLIENT_VERSION, 2,
51 EGL_NONE 52 EGL_NONE
52 }; 53 };
53 54
54 GLSurfaceEGL* egl_surface = static_cast<GLSurfaceEGL*>(compatible_surface); 55 GLSurfaceEGL* egl_surface = static_cast<GLSurfaceEGL*>(compatible_surface);
55 display_ = egl_surface->GetDisplay(); 56 display_ = egl_surface->GetDisplay();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 void GLContextEGL::SetSwapInterval(int interval) { 140 void GLContextEGL::SetSwapInterval(int interval) {
140 DCHECK(IsCurrent(NULL)); 141 DCHECK(IsCurrent(NULL));
141 if (!eglSwapInterval(display_, interval)) { 142 if (!eglSwapInterval(display_, interval)) {
142 LOG(ERROR) << "eglSwapInterval failed with error " 143 LOG(ERROR) << "eglSwapInterval failed with error "
143 << GetLastEGLErrorString(); 144 << GetLastEGLErrorString();
144 } 145 }
145 } 146 }
146 147
147 } // namespace gfx 148 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_egl.h ('k') | ui/gfx/gl/gl_context_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698