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

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

Issue 2106703002: Apply FRAMEBUFFER_SRGB for blitFramebuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 74abce022062a0e6a5d22c7e71e7e0d028c44717..046f304c63104d1b862438027d896e9de145e93f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1329,6 +1329,9 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
bool clear_uncleared_images, const char* func_name);
// Generates |gl_error| if the bound read fbo is incomplete.
bool CheckBoundReadFramebufferValid(const char* func_name, GLenum gl_error);
+ // This is only used by DoBlitFramebufferCHROMIUM which operates read/draw
+ // framebuffer at the same time.
+ bool CheckBoundFramebufferValid(const char* func_name);
// Checks if the current program exists and is valid. If not generates the
// appropriate GL error. Returns true if the current program is in a usable
@@ -4016,6 +4019,31 @@ bool GLES2DecoderImpl::CheckBoundReadFramebufferValid(
return valid;
}
+bool GLES2DecoderImpl::CheckBoundFramebufferValid(const char* func_name) {
+ GLenum target = features().chromium_framebuffer_multisample ?
+ GL_DRAW_FRAMEBUFFER : GL_FRAMEBUFFER;
+ Framebuffer* draw_framebuffer = GetFramebufferInfoForTarget(target);
+ bool valid = CheckFramebufferValid(
+ draw_framebuffer, target, true,
+ GL_INVALID_FRAMEBUFFER_OPERATION, func_name);
+
+ target = features().chromium_framebuffer_multisample ?
+ GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER;
+ Framebuffer* read_framebuffer = GetFramebufferInfoForTarget(target);
+ valid = valid && CheckFramebufferValid(
+ read_framebuffer, target, true,
+ GL_INVALID_FRAMEBUFFER_OPERATION, func_name);
+
+ if (valid && feature_info_->feature_flags().desktop_srgb_support) {
+ bool enable_framebuffer_srgb =
+ (draw_framebuffer && draw_framebuffer->HasSRGBAttachments()) ||
+ (read_framebuffer && read_framebuffer->HasSRGBAttachments());
+ state_.EnableDisableFramebufferSRGB(enable_framebuffer_srgb);
+ }
+
+ return valid;
+}
+
GLint GLES2DecoderImpl::GetColorEncodingFromInternalFormat(
GLenum internalformat) {
switch (internalformat) {
@@ -7168,9 +7196,7 @@ void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
const char* func_name = "glBlitFramebufferCHROMIUM";
DCHECK(!ShouldDeferReads() && !ShouldDeferDraws());
- if (!CheckBoundDrawFramebufferValid(true, func_name) ||
- !CheckBoundReadFramebufferValid(func_name,
- GL_INVALID_FRAMEBUFFER_OPERATION)) {
+ if (!CheckBoundFramebufferValid(func_name)) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698