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

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

Issue 2351093002: Fix crash in BlitFramebufferCHROMIUM if a read or draw depth/stencil buffer is not present (Closed)
Patch Set: rebase Created 4 years, 3 months 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
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698