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

Side by Side Diff: content/gpu/gpu_info_collector.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
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 "content/gpu/gpu_info_collector.h" 5 #include "content/gpu/gpu_info_collector.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 14 matching lines...) Expand all
25 LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed"; 25 LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed";
26 return NULL; 26 return NULL;
27 } 27 }
28 28
29 return surface; 29 return surface;
30 } 30 }
31 31
32 scoped_refptr<gfx::GLContext> InitializeGLContext(gfx::GLSurface* surface) { 32 scoped_refptr<gfx::GLContext> InitializeGLContext(gfx::GLSurface* surface) {
33 33
34 scoped_refptr<gfx::GLContext> context( 34 scoped_refptr<gfx::GLContext> context(
35 gfx::GLContext::CreateGLContext(NULL, surface)); 35 gfx::GLContext::CreateGLContext(NULL,
36 surface,
37 gfx::PreferIntegratedGpu));
36 if (!context.get()) { 38 if (!context.get()) {
37 LOG(ERROR) << "gfx::GLContext::CreateGLContext failed"; 39 LOG(ERROR) << "gfx::GLContext::CreateGLContext failed";
38 return NULL; 40 return NULL;
39 } 41 }
40 42
41 if (!context->MakeCurrent(surface)) { 43 if (!context->MakeCurrent(surface)) {
42 LOG(ERROR) << "gfx::GLContext::MakeCurrent() failed"; 44 LOG(ERROR) << "gfx::GLContext::MakeCurrent() failed";
43 return NULL; 45 return NULL;
44 } 46 }
45 47
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 117
116 std::string glsl_version = GetVersionFromString(glsl_version_string); 118 std::string glsl_version = GetVersionFromString(glsl_version_string);
117 gpu_info->pixel_shader_version = glsl_version; 119 gpu_info->pixel_shader_version = glsl_version;
118 gpu_info->vertex_shader_version = glsl_version; 120 gpu_info->vertex_shader_version = glsl_version;
119 121
120 return true; 122 return true;
121 } 123 }
122 124
123 } // namespace gpu_info_collector 125 } // namespace gpu_info_collector
124 126
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698