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

Side by Side Diff: gpu/config/gpu_info_collector.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 Created 6 years, 10 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) 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 "gpu/config/gpu_info_collector.h" 5 #include "gpu/config/gpu_info_collector.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 return std::string(); 76 return std::string();
77 } 77 }
78 78
79 } // namespace anonymous 79 } // namespace anonymous
80 80
81 namespace gpu { 81 namespace gpu {
82 82
83 bool CollectGraphicsInfoGL(GPUInfo* gpu_info) { 83 bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
84 TRACE_EVENT0("startup", "gpu_info_collector::CollectGraphicsInfoGL"); 84 TRACE_EVENT0("startup", "gpu_info_collector::CollectGraphicsInfoGL");
85 if (!gfx::GLSurface::InitializeOneOff()) {
86 LOG(ERROR) << "gfx::GLSurface::InitializeOneOff() failed";
87 return false;
88 }
89 85
90 scoped_refptr<gfx::GLSurface> surface(InitializeGLSurface()); 86 scoped_refptr<gfx::GLSurface> surface(InitializeGLSurface());
91 if (!surface.get()) 87 if (!surface.get())
92 return false; 88 return false;
93 89
94 scoped_refptr<gfx::GLContext> context(InitializeGLContext(surface.get())); 90 scoped_refptr<gfx::GLContext> context(InitializeGLContext(surface.get()));
95 if (!context.get()) 91 if (!context.get())
96 return false; 92 return false;
97 93
98 gpu_info->gl_renderer = GetGLString(GL_RENDERER); 94 gpu_info->gl_renderer = GetGLString(GL_RENDERER);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 basic_gpu_info->driver_version = context_gpu_info.driver_version; 148 basic_gpu_info->driver_version = context_gpu_info.driver_version;
153 149
154 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context; 150 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context;
155 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; 151 basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
156 basic_gpu_info->finalized = context_gpu_info.finalized; 152 basic_gpu_info->finalized = context_gpu_info.finalized;
157 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; 153 basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
158 } 154 }
159 155
160 } // namespace gpu 156 } // namespace gpu
161 157
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | gpu/config/gpu_info_collector_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698