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

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

Issue 2496813002: [Command buffer] workaround the framebuffer completeness bug for Intel Mac (Closed)
Patch Set: Reset (not restore) read buffer and/or draw buffers for all read/draw related APIs Created 4 years, 1 month 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/framebuffer_manager.cc
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index 0fd59c5fd6ba1dfb618709f97b1a8269481fd6d2..f8d8405aa7a4241e6928a6058bbf412964ef9fa1 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -611,6 +611,44 @@ bool Framebuffer::HasStencilAttachment() const {
return attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end();
}
+bool Framebuffer::ReadBufferHasNoImage() const {
+ if (read_buffer_ == GL_NONE) {
+ return false;
+ }
+ AttachmentMap::const_iterator it = attachments_.find(read_buffer_);
+ if (it == attachments_.end()) {
Zhenyao Mo 2016/11/14 19:42:24 Just return it == attachments_.end().
yunchao 2016/11/15 16:21:58 Done.
+ return true;
+ }
+ return false;
+}
+
+bool Framebuffer::DrawBuffersHaveNoImage(GLsizei& num, GLenum* buf) const {
+ bool ret = false;
+ for (GLenum i = 0; i < manager_->max_draw_buffers_; ++i) {
+ if (draw_buffers_[i] == GL_NONE) {
+ buf[i] = GL_NONE;
+ continue;
+ }
+ const Attachment* attachment = GetAttachment(draw_buffers_[i]);
+ if (attachment) {
+ buf[i] = GL_COLOR_ATTACHMENT0 + i;
Zhenyao Mo 2016/11/14 19:42:24 Here you should DCHECK(buf[i] == GL_COLOR_ATTACHME
yunchao 2016/11/15 16:21:58 Not re-assign. The buf[] passed in are all GL_NONE
+ ++num;
Zhenyao Mo 2016/11/14 19:42:24 Here you assume num is initialized to zero by call
yunchao 2016/11/15 16:21:58 See the explanation elsewhere.
+ } else {
+ buf[i] = GL_NONE;
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+bool Framebuffer::ColorBuffersHaveImage() const {
+ for (GLenum i = 0; i < manager_->max_color_attachments_; i++) {
+ if (attachments_.find(GL_COLOR_ATTACHMENT0 + i) != attachments_.end())
+ return true;
+ }
+ return false;
+}
+
GLenum Framebuffer::GetReadBufferInternalFormat() const {
if (read_buffer_ == GL_NONE)
return 0;

Powered by Google App Engine
This is Rietveld 408576698