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

Side by Side 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 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 // Wrapper for glUseProgram 1858 // Wrapper for glUseProgram
1859 void DoUseProgram(GLuint program); 1859 void DoUseProgram(GLuint program);
1860 1860
1861 // Wrapper for glValidateProgram. 1861 // Wrapper for glValidateProgram.
1862 void DoValidateProgram(GLuint program_client_id); 1862 void DoValidateProgram(GLuint program_client_id);
1863 1863
1864 void DoInsertEventMarkerEXT(GLsizei length, const GLchar* marker); 1864 void DoInsertEventMarkerEXT(GLsizei length, const GLchar* marker);
1865 void DoPushGroupMarkerEXT(GLsizei length, const GLchar* group); 1865 void DoPushGroupMarkerEXT(GLsizei length, const GLchar* group);
1866 void DoPopGroupMarkerEXT(void); 1866 void DoPopGroupMarkerEXT(void);
1867 1867
1868 // Wrapper for PerformanceHintCHROMIUM.
1869 void DoPerformanceHintCHROMIUM(GLenum mode);
1870
1868 // Gets the number of values that will be returned by glGetXXX. Returns 1871 // Gets the number of values that will be returned by glGetXXX. Returns
1869 // false if pname is unknown. 1872 // false if pname is unknown.
1870 bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values); 1873 bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values);
1871 1874
1872 // Checks if every attribute's type set by vertexAttrib API match 1875 // Checks if every attribute's type set by vertexAttrib API match
1873 // the type of corresponding attribute in vertex shader. 1876 // the type of corresponding attribute in vertex shader.
1874 bool AttribsTypeMatch(); 1877 bool AttribsTypeMatch();
1875 1878
1876 // Checks if the current program and vertex attributes are valid for drawing. 1879 // Checks if the current program and vertex attributes are valid for drawing.
1877 bool IsDrawValid( 1880 bool IsDrawValid(
(...skipping 17247 matching lines...) Expand 10 before | Expand all | Expand 10 after
19125 glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture_ref->service_id()); 19128 glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture_ref->service_id());
19126 } 19129 }
19127 } 19130 }
19128 19131
19129 glActiveTexture(GL_TEXTURE0 + state_.active_texture_unit); 19132 glActiveTexture(GL_TEXTURE0 + state_.active_texture_unit);
19130 19133
19131 texture_manager_service_id_generation_ = 19134 texture_manager_service_id_generation_ =
19132 texture_manager()->GetServiceIdGeneration(); 19135 texture_manager()->GetServiceIdGeneration();
19133 } 19136 }
19134 19137
19138 void GLES2DecoderImpl::DoPerformanceHintCHROMIUM(GLenum mode) {
19139 switch (mode) {
19140 case GL_LOW_POWER_CHROMIUM:
19141 context_->SetPerformancePreference(gl::PreferLowPower);
19142 break;
19143 case GL_DEFAULT_POWER_CHROMIUM:
19144 context_->SetPerformancePreference(gl::PreferDefaultPerformance);
19145 break;
19146 case GL_HIGH_PERFORMANCE_CHROMIUM:
19147 context_->SetPerformancePreference(gl::PreferHighPerformance);
19148 break;
19149 }
19150 }
19151
19135 // Include the auto-generated part of this file. We split this because it means 19152 // Include the auto-generated part of this file. We split this because it means
19136 // we can easily edit the non-auto generated parts right here in this file 19153 // we can easily edit the non-auto generated parts right here in this file
19137 // instead of having to edit some template or the code generator. 19154 // instead of having to edit some template or the code generator.
19138 #include "base/macros.h" 19155 #include "base/macros.h"
19139 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19156 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19140 19157
19141 } // namespace gles2 19158 } // namespace gles2
19142 } // namespace gpu 19159 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698