| 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 bool Framebuffer::HasDepthAttachment() const { | 465 bool Framebuffer::HasDepthAttachment() const { |
| 466 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || | 466 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
| 467 attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); | 467 attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 bool Framebuffer::HasStencilAttachment() const { | 470 bool Framebuffer::HasStencilAttachment() const { |
| 471 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || | 471 return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
| 472 attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); | 472 attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 GLenum Framebuffer::GetColorAttachment0Format() const { |
| 476 AttachmentMap::const_iterator it = attachments_.find(GL_COLOR_ATTACHMENT0); |
| 477 if (it == attachments_.end()) { |
| 478 return 0; |
| 479 } |
| 480 const Attachment* attachment = it->second.get(); |
| 481 return attachment->internal_format(); |
| 482 } |
| 483 |
| 475 GLenum Framebuffer::GetReadBufferInternalFormat() const { | 484 GLenum Framebuffer::GetReadBufferInternalFormat() const { |
| 476 if (read_buffer_ == GL_NONE) | 485 if (read_buffer_ == GL_NONE) |
| 477 return 0; | 486 return 0; |
| 478 AttachmentMap::const_iterator it = attachments_.find(read_buffer_); | 487 AttachmentMap::const_iterator it = attachments_.find(read_buffer_); |
| 479 if (it == attachments_.end()) { | 488 if (it == attachments_.end()) { |
| 480 return 0; | 489 return 0; |
| 481 } | 490 } |
| 482 const Attachment* attachment = it->second.get(); | 491 const Attachment* attachment = it->second.get(); |
| 483 return attachment->internal_format(); | 492 return attachment->internal_format(); |
| 484 } | 493 } |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 | 793 |
| 785 bool FramebufferManager::IsComplete( | 794 bool FramebufferManager::IsComplete( |
| 786 Framebuffer* framebuffer) { | 795 Framebuffer* framebuffer) { |
| 787 DCHECK(framebuffer); | 796 DCHECK(framebuffer); |
| 788 return framebuffer->framebuffer_complete_state_count_id() == | 797 return framebuffer->framebuffer_complete_state_count_id() == |
| 789 framebuffer_state_change_count_; | 798 framebuffer_state_change_count_; |
| 790 } | 799 } |
| 791 | 800 |
| 792 } // namespace gles2 | 801 } // namespace gles2 |
| 793 } // namespace gpu | 802 } // namespace gpu |
| OLD | NEW |