| 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 acccab8cdd9b1ee71c747d32673c96e6694eec95..7a29b72a259b9c7b4f3a96f5bc05d223e36b8d6b 100644
|
| --- a/gpu/command_buffer/service/framebuffer_manager.cc
|
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc
|
| @@ -692,26 +692,36 @@ GLsizei Framebuffer::GetSamples() const {
|
| return attachment->samples();
|
| }
|
|
|
| -GLenum Framebuffer::GetDepthFormat() const {
|
| +const Framebuffer::Attachment* Framebuffer::GetDepthAttachment() const {
|
| auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT);
|
| if (iter == attachments_.end())
|
| iter = attachments_.find(GL_DEPTH_ATTACHMENT);
|
| if (iter == attachments_.end())
|
| - return 0;
|
| + return nullptr;
|
| Attachment* attachment = iter->second.get();
|
| DCHECK(attachment);
|
| - return attachment->internal_format();
|
| + return attachment;
|
| }
|
|
|
| -GLenum Framebuffer::GetStencilFormat() const {
|
| +const Framebuffer::Attachment* Framebuffer::GetStencilAttachment() const {
|
| auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT);
|
| if (iter == attachments_.end())
|
| iter = attachments_.find(GL_STENCIL_ATTACHMENT);
|
| if (iter == attachments_.end())
|
| - return 0;
|
| + return nullptr;
|
| Attachment* attachment = iter->second.get();
|
| DCHECK(attachment);
|
| - return attachment->internal_format();
|
| + return attachment;
|
| +}
|
| +
|
| +GLenum Framebuffer::GetDepthFormat() const {
|
| + const Attachment* attachment = GetDepthAttachment();
|
| + return attachment ? attachment->internal_format() : 0;
|
| +}
|
| +
|
| +GLenum Framebuffer::GetStencilFormat() const {
|
| + const Attachment* attachment = GetStencilAttachment();
|
| + return attachment ? attachment->internal_format() : 0;
|
| }
|
|
|
| GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
|
|
|