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

Unified Diff: gpu/command_buffer/service/context_state_impl_autogen.h

Issue 15792007: gpu: Autogenerate glHint state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch-case instead of if-series. Created 7 years, 7 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
« no previous file with comments | « gpu/command_buffer/service/context_state_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_state_impl_autogen.h
diff --git a/gpu/command_buffer/service/context_state_impl_autogen.h b/gpu/command_buffer/service/context_state_impl_autogen.h
index 5342435814172ff79bdff9f5a1137e243fb986cc..bd71bddf7e4b7b24faf1aa5f64120e69036654f4 100644
--- a/gpu/command_buffer/service/context_state_impl_autogen.h
+++ b/gpu/command_buffer/service/context_state_impl_autogen.h
@@ -49,6 +49,8 @@ void ContextState::Initialize() {
z_near = 0.0f;
z_far = 1.0f;
front_face = GL_CCW;
+ hint_generate_mipmap = GL_DONT_CARE;
+ hint_fragment_shader_derivative = GL_DONT_CARE;
line_width = 1.0f;
polygon_offset_factor = 0.0f;
polygon_offset_units = 0.0f;
@@ -108,6 +110,10 @@ void ContextState::InitState() const {
glDepthMask(depth_mask);
glDepthRange(z_near, z_far);
glFrontFace(front_face);
+ glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
+ if (feature_info_->feature_flags().oes_standard_derivatives)
+ glHint(
+ GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, hint_fragment_shader_derivative);
glLineWidth(line_width);
glPolygonOffset(polygon_offset_factor, polygon_offset_units);
glSampleCoverage(sample_coverage_value, sample_coverage_invert);
@@ -209,6 +215,18 @@ bool ContextState::GetStateAsGLint(
params[0] = static_cast<GLint>(stencil_clear);
}
return true;
+ case GL_GENERATE_MIPMAP_HINT:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(hint_generate_mipmap);
+ }
+ return true;
+ case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(hint_fragment_shader_derivative);
+ }
+ return true;
case GL_COLOR_WRITEMASK:
*num_written = 4;
if (params) {
@@ -509,6 +527,18 @@ bool ContextState::GetStateAsGLfloat(
params[0] = static_cast<GLfloat>(stencil_clear);
}
return true;
+ case GL_GENERATE_MIPMAP_HINT:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(hint_generate_mipmap);
+ }
+ return true;
+ case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative);
+ }
+ return true;
case GL_COLOR_WRITEMASK:
*num_written = 4;
if (params) {
« no previous file with comments | « gpu/command_buffer/service/context_state_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698