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

Unified Diff: gpu/command_buffer/service/context_state.cc

Issue 1135943002: Pull in various gpu/command_buffer fixes from chromium (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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.h ('k') | gpu/command_buffer/service/context_state_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_state.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index eb7fc4933dbdcf60682554abe09f2156c2a10890..5c5da8275053b1abfc106abf9dea885472572854 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -20,14 +20,6 @@ namespace gles2 {
namespace {
-static void EnableDisable(GLenum pname, bool enable) {
- if (enable) {
- glEnable(pname);
- } else {
- glDisable(pname);
- }
-}
-
GLuint Get2dServiceId(const TextureUnit& unit) {
return unit.bound_texture_2d.get()
? unit.bound_texture_2d->service_id() : 0;
@@ -96,7 +88,7 @@ ContextState::ContextState(FeatureInfo* feature_info,
bound_renderbuffer_valid(false),
pack_reverse_row_order(false),
ignore_cached_state(false),
- fbo_binding_for_scissor_workaround_dirty_(false),
+ fbo_binding_for_scissor_workaround_dirty(false),
feature_info_(feature_info),
error_state_(ErrorState::Create(error_state_client, logger)) {
Initialize();
@@ -291,6 +283,18 @@ ErrorState* ContextState::GetErrorState() {
return error_state_.get();
}
+void ContextState::EnableDisable(GLenum pname, bool enable) const {
+ if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
+ if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index)
+ pname = GL_PRIMITIVE_RESTART;
+ }
+ if (enable) {
+ glEnable(pname);
+ } else {
+ glDisable(pname);
+ }
+}
+
// 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.
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/context_state_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698