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

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

Issue 2268503002: [Command Buffer] enable/disable FRAMEBUFFER_SRGB only when sRGB image is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: encapusulate some code to a function 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
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 e9e4de8bb8174d729c271dd43a181791b408c174..c9e4199636ee5250fed5b3853b4439c6b97f855b 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -495,15 +495,13 @@ 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_) {
yunchao 2016/08/24 14:08:51 It is OK to keep Qiankun's code here. I just want
qiankun 2016/08/24 16:21:00 Agree with you.
+ if (prev_state && framebuffer_srgb_ != prev_state->framebuffer_srgb_) {
// FRAMEBUFFER_SRGB will be restored lazily at render time.
qiankun 2016/08/24 16:22:13 This comment is wrong in your current implementati
yunchao 2016/08/25 16:29:51 That's true.
framebuffer_srgb_ = prev_state->framebuffer_srgb_;
}
+ if (feature_info_->feature_flags().desktop_srgb_support) {
+ EnableDisable(GL_FRAMEBUFFER_SRGB, framebuffer_srgb_);
Zhenyao Mo 2016/08/25 00:39:37 That's what we try to avoid. If we use virtual co
yunchao 2016/08/25 16:29:51 You are correct. The original code is better.
+ }
}
ErrorState* ContextState::GetErrorState() {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698