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

Side by Side Diff: ui/gl/gl_context.cc

Issue 2627323007: Migrate WebGL contexts on backgrounded tabs to the integrated GPU.
Patch Set: Created 3 years, 11 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 "ui/gl/gl_context.h" 5 #include "ui/gl/gl_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DCHECK(IsCurrent(nullptr)); 90 DCHECK(IsCurrent(nullptr));
91 const char *renderer = 91 const char *renderer =
92 reinterpret_cast<const char*>(glGetString(GL_RENDERER)); 92 reinterpret_cast<const char*>(glGetString(GL_RENDERER));
93 return std::string(renderer ? renderer : ""); 93 return std::string(renderer ? renderer : "");
94 } 94 }
95 95
96 YUVToRGBConverter* GLContext::GetYUVToRGBConverter() { 96 YUVToRGBConverter* GLContext::GetYUVToRGBConverter() {
97 return nullptr; 97 return nullptr;
98 } 98 }
99 99
100 void GLContext::SetPerformancePreference(GpuPerformancePreference pref) {
101 }
102
100 bool GLContext::HasExtension(const char* name) { 103 bool GLContext::HasExtension(const char* name) {
101 std::string extensions = GetExtensions(); 104 std::string extensions = GetExtensions();
102 extensions += " "; 105 extensions += " ";
103 106
104 std::string delimited_name(name); 107 std::string delimited_name(name);
105 delimited_name += " "; 108 delimited_name += " ";
106 109
107 return extensions.find(delimited_name) != std::string::npos; 110 return extensions.find(delimited_name) != std::string::npos;
108 } 111 }
109 112
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 276
274 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, 277 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context,
275 GLSurface* compatible_surface, 278 GLSurface* compatible_surface,
276 const GLContextAttribs& attribs) { 279 const GLContextAttribs& attribs) {
277 if (!context->Initialize(compatible_surface, attribs)) 280 if (!context->Initialize(compatible_surface, attribs))
278 return nullptr; 281 return nullptr;
279 return context; 282 return context;
280 } 283 }
281 284
282 } // namespace gl 285 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_context.h ('k') | ui/gl/gl_context_cgl.h » ('j') | ui/gl/gl_context_cgl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698