Chromium Code Reviews| 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..6cf36dbc0b2cffd9f1c3713c401621f20b2ca8c9 100644 |
| --- a/gpu/command_buffer/service/framebuffer_manager.cc |
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc |
| @@ -611,6 +611,38 @@ 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()) { |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| +bool Framebuffer::DrawBuffersHaveNoImage() const { |
| + for (GLenum i = 0; i < manager_->max_draw_buffers_; ++i) { |
| + if (draw_buffers_[i] == GL_NONE) { |
| + continue; |
| + } |
| + const Attachment* attachment = GetAttachment(draw_buffers_[i]); |
| + if (attachment) { |
| + return false; |
| + } |
| + } |
| + return true; |
| +} |
| + |
| +bool Framebuffer::ColorBuffersHaveImage() const { |
| + for (GLenum i = 0; i < manager_->max_color_attachments_; i++) { |
| + if (attachments_.find(GL_COLOR_ATTACHMENT0 + i) != attachments_.end()) |
|
qiankun
2016/11/11 15:30:48
Why don't check attachment != NULL (i.e. attachmen
yunchao
2016/11/15 16:04:34
It is unnecessary. see the other code like HasColo
|
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| GLenum Framebuffer::GetReadBufferInternalFormat() const { |
| if (read_buffer_ == GL_NONE) |
| return 0; |