Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/context_state.h" | 5 #include "gpu/command_buffer/service/context_state.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 10 #include "gpu/command_buffer/service/buffer_manager.h" | 10 #include "gpu/command_buffer/service/buffer_manager.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 RestoreProgramBindings(); | 278 RestoreProgramBindings(); |
| 279 RestoreGlobalState(prev_state); | 279 RestoreGlobalState(prev_state); |
| 280 } | 280 } |
| 281 | 281 |
| 282 ErrorState* ContextState::GetErrorState() { | 282 ErrorState* ContextState::GetErrorState() { |
| 283 return error_state_.get(); | 283 return error_state_.get(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ContextState::EnableDisable(GLenum pname, bool enable) const { | 286 void ContextState::EnableDisable(GLenum pname, bool enable) const { |
| 287 if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) { | 287 if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) { |
| 288 // This is only available on Desktop GL 4.3+, but we emulate ES 3.0 on top | 288 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) |
| 289 // of Desktop GL 4.2+. | 289 pname = GL_PRIMITIVE_RESTART; |
| 290 const gfx::GLVersionInfo& gl_version = feature_info_->gl_version_info(); | |
| 291 if (!gl_version.is_es && | |
| 292 (gl_version.major_version < 4 || | |
| 293 (gl_version.major_version == 4 && gl_version.minor_version < 3))) { | |
| 294 // TODO(zmo): Ignoring it may not be the best emulation. | |
| 295 NOTIMPLEMENTED(); | |
|
Zhenyao Mo
2015/04/24 21:40:42
We need to remove this NOTIMPLEMENTED() because it
| |
| 296 return; | |
| 297 } | |
| 298 } | 290 } |
| 299 if (enable) { | 291 if (enable) { |
| 300 glEnable(pname); | 292 glEnable(pname); |
| 301 } else { | 293 } else { |
| 302 glDisable(pname); | 294 glDisable(pname); |
| 303 } | 295 } |
| 304 } | 296 } |
| 305 | 297 |
| 306 // Include the auto-generated part of this file. We split this because it means | 298 // Include the auto-generated part of this file. We split this because it means |
| 307 // we can easily edit the non-auto generated parts right here in this file | 299 // we can easily edit the non-auto generated parts right here in this file |
| 308 // instead of having to edit some template or the code generator. | 300 // instead of having to edit some template or the code generator. |
| 309 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 301 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
| 310 | 302 |
| 311 } // namespace gles2 | 303 } // namespace gles2 |
| 312 } // namespace gpu | 304 } // namespace gpu |
| 313 | 305 |
| 314 | 306 |
| OLD | NEW |