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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c4470e8163b9bcad02becb46d5487236d218cb2c..11e1fc76d7923499d60904a39ed9cde87ce02bb4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1865,6 +1865,9 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
void DoPushGroupMarkerEXT(GLsizei length, const GLchar* group);
void DoPopGroupMarkerEXT(void);
+ // Wrapper for PerformanceHintCHROMIUM.
+ void DoPerformanceHintCHROMIUM(GLenum mode);
+
// Gets the number of values that will be returned by glGetXXX. Returns
// false if pname is unknown.
bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values);
@@ -19132,6 +19135,20 @@ void GLES2DecoderImpl::RestoreAllExternalTextureBindingsIfNeeded() {
texture_manager()->GetServiceIdGeneration();
}
+void GLES2DecoderImpl::DoPerformanceHintCHROMIUM(GLenum mode) {
+ switch (mode) {
+ case GL_LOW_POWER_CHROMIUM:
+ context_->SetPerformancePreference(gl::PreferLowPower);
+ break;
+ case GL_DEFAULT_POWER_CHROMIUM:
+ context_->SetPerformancePreference(gl::PreferDefaultPerformance);
+ break;
+ case GL_HIGH_PERFORMANCE_CHROMIUM:
+ context_->SetPerformancePreference(gl::PreferHighPerformance);
+ break;
+ }
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.

Powered by Google App Engine
This is Rietveld 408576698