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

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

Issue 2246823002: Disable FRAMEBUFFER_SRGB when restoring from a null context state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gpu_unittests Created 4 years, 4 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/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 c19ffa5272b5746ecf65646b057a25364cd65693..5bb4ef16df4208aae14b108e612137d31c2f9d97 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -221,7 +221,7 @@ ContextState::ContextState(FeatureInfo* feature_info,
pack_reverse_row_order(false),
ignore_cached_state(false),
fbo_binding_for_scissor_workaround_dirty(false),
- framebuffer_srgb_(false),
+ framebuffer_srgb_(FRAMEBUFFER_SRGB_DISABLED),
feature_info_(feature_info),
error_state_(ErrorState::Create(error_state_client, logger)) {
Initialize();
@@ -495,7 +495,9 @@ void ContextState::RestoreState(const ContextState* prev_state) {
RestoreIndexedUniformBufferBindings(prev_state);
RestoreGlobalState(prev_state);
- if (prev_state && framebuffer_srgb_ != prev_state->framebuffer_srgb_) {
+ if (!prev_state) {
+ framebuffer_srgb_ = FRAMEBUFFER_SRGB_UNDEFINED;
Zhenyao Mo 2016/08/17 17:21:09 Per our discussion, this should be DISABLED. Actu
qiankun 2016/08/18 00:19:56 I still cannot revert these changes. There are sti
+ } else if (framebuffer_srgb_ != prev_state->framebuffer_srgb_) {
// FRAMEBUFFER_SRGB will be restored lazily at render time.
framebuffer_srgb_ = prev_state->framebuffer_srgb_;
}
@@ -687,10 +689,11 @@ PixelStoreParams ContextState::GetUnpackParams(Dimension dimension) {
return params;
}
-void ContextState::EnableDisableFramebufferSRGB(bool enable) {
+void ContextState::EnableDisableFramebufferSRGB(FramebufferSRGBState enable) {
if (framebuffer_srgb_ == enable)
return;
- EnableDisable(GL_FRAMEBUFFER_SRGB, enable);
+ EnableDisable(GL_FRAMEBUFFER_SRGB,
+ enable == FRAMEBUFFER_SRGB_ENABLED ? true : false);
framebuffer_srgb_ = enable;
}
« 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