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

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: 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
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..9dc45823d02ebab8c3dee1bd37a764ce0223b858 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,9 @@ void ContextState::InitState() const {
glDepthMask(depth_mask);
glDepthRange(z_near, z_far);
glFrontFace(front_face);
+ glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap);
+ glHint(
greggman 2013/05/30 17:15:24 You can't init state that is dependent on extensio
Sami 2013/05/30 18:59:45 Done.
+ 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 +214,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 +526,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) {

Powered by Google App Engine
This is Rietveld 408576698