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

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

Issue 2542343003: Prep work for adding command buffer support for EXT_sRGB_write_control (Closed)
Patch Set: Created 4 years 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/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.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index 94192a6129b60afddd03bd3597aa5876f8b62f03..5aa24fbacd095e7c09ea022d30254b49588ba9fe 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -221,7 +221,6 @@ ContextState::ContextState(FeatureInfo* feature_info,
pack_reverse_row_order(false),
ignore_cached_state(false),
fbo_binding_for_scissor_workaround_dirty(false),
- framebuffer_srgb_(false),
feature_info_(feature_info),
error_state_(ErrorState::Create(error_state_client, logger)) {
Initialize();
@@ -505,15 +504,8 @@ void ContextState::RestoreState(const ContextState* prev_state) {
RestoreIndexedUniformBufferBindings(prev_state);
RestoreGlobalState(prev_state);
- if (!prev_state) {
- if (feature_info_->feature_flags().desktop_srgb_support) {
- framebuffer_srgb_ = false;
- glDisable(GL_FRAMEBUFFER_SRGB);
- }
- } else if (framebuffer_srgb_ != prev_state->framebuffer_srgb_) {
- // FRAMEBUFFER_SRGB will be restored lazily at render time.
- framebuffer_srgb_ = prev_state->framebuffer_srgb_;
- }
+ // FRAMEBUFFER_SRGB will be restored lazily at render time.
+ framebuffer_srgb_valid_ = false;
}
ErrorState* ContextState::GetErrorState() {
@@ -706,10 +698,11 @@ PixelStoreParams ContextState::GetUnpackParams(Dimension dimension) {
}
void ContextState::EnableDisableFramebufferSRGB(bool enable) {
- if (framebuffer_srgb_ == enable)
+ if (framebuffer_srgb_valid_ && framebuffer_srgb_ == enable)
return;
EnableDisable(GL_FRAMEBUFFER_SRGB, enable);
framebuffer_srgb_ = enable;
+ framebuffer_srgb_valid_ = true;
}
void ContextState::InitStateManual(const ContextState*) const {
« no previous file with comments | « gpu/command_buffer/service/context_state.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