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

Unified Diff: gpu/command_buffer/service/framebuffer_manager.h

Issue 315283002: Framebuffer clear() needs to consider the situation some draw buffers are disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/framebuffer_manager.h
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h
index 129d5f348ef65de63410a7cdf0635c0b872f4203..b68ab7d9f1209710bc994d02bc1ebb7c9344e2a5 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -64,6 +64,7 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
}
bool HasUnclearedAttachment(GLenum attachment) const;
+ bool HasUnclearedColorAttachments() const;
void MarkAttachmentAsCleared(
RenderbufferManager* renderbuffer_manager,
@@ -129,6 +130,14 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
void SetDrawBuffers(GLsizei n, const GLenum* bufs);
+ // If a color buffer is attached to GL_COLOR_ATTACHMENTi, enable that
+ // draw buffer for glClear().
+ void PrepareDrawBuffersForClear() const;
+
+ // Restore draw buffers states that have been changed in
+ // PrepareDrawBuffersForClear().
+ void RestoreDrawBuffersAfterClear() const;
+
// Return true if any draw buffers has an alpha channel.
bool HasAlphaMRT() const;
@@ -163,6 +172,10 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
return framebuffer_complete_state_count_id_;
}
+ // Helper function for PrepareDrawBuffersForClear() and
+ // RestoreDrawBuffersAfterClear().
+ void ChangeDrawBuffersHelper(bool recover) const;
+
// The managers that owns this.
FramebufferManager* manager_;
« no previous file with comments | « no previous file | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698