| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/framebuffer_manager.h" | 5 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 bool cleared) { | 545 bool cleared) { |
| 546 for (AttachmentMap::iterator it = attachments_.begin(); | 546 for (AttachmentMap::iterator it = attachments_.begin(); |
| 547 it != attachments_.end(); ++it) { | 547 it != attachments_.end(); ++it) { |
| 548 Attachment* attachment = it->second.get(); | 548 Attachment* attachment = it->second.get(); |
| 549 if (attachment->cleared() != cleared) { | 549 if (attachment->cleared() != cleared) { |
| 550 attachment->SetCleared(renderbuffer_manager, texture_manager, cleared); | 550 attachment->SetCleared(renderbuffer_manager, texture_manager, cleared); |
| 551 } | 551 } |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 | 554 |
| 555 bool Framebuffer::HasColorAttachment(int index) const { |
| 556 return attachments_.find(GL_COLOR_ATTACHMENT0 + index) != attachments_.end(); |
| 557 } |
| 558 |
| 555 bool Framebuffer::HasDepthAttachment() const { | 559 bool Framebuffer::HasDepthAttachment() const { |
| 556 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || | 560 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
| 557 attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); | 561 attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
| 558 } | 562 } |
| 559 | 563 |
| 560 bool Framebuffer::HasStencilAttachment() const { | 564 bool Framebuffer::HasStencilAttachment() const { |
| 561 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || | 565 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
| 562 attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); | 566 attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
| 563 } | 567 } |
| 564 | 568 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 | 934 |
| 931 bool FramebufferManager::IsComplete( | 935 bool FramebufferManager::IsComplete( |
| 932 Framebuffer* framebuffer) { | 936 Framebuffer* framebuffer) { |
| 933 DCHECK(framebuffer); | 937 DCHECK(framebuffer); |
| 934 return framebuffer->framebuffer_complete_state_count_id() == | 938 return framebuffer->framebuffer_complete_state_count_id() == |
| 935 framebuffer_state_change_count_; | 939 framebuffer_state_change_count_; |
| 936 } | 940 } |
| 937 | 941 |
| 938 } // namespace gles2 | 942 } // namespace gles2 |
| 939 } // namespace gpu | 943 } // namespace gpu |
| OLD | NEW |