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 cec5b104b7ab678b71a164d4da999293e99df8a8..e77a1c0c605a6c79190f548a60d807fed8efb29a 100644 |
--- a/gpu/command_buffer/service/framebuffer_manager.cc |
+++ b/gpu/command_buffer/service/framebuffer_manager.cc |
@@ -106,7 +106,7 @@ class RenderbufferAttachment |
attachment_type, max_color_attachments); |
DCHECK_NE(0u, need); |
uint32_t have = GLES2Util::GetChannelsForFormat(internal_format()); |
- if (context_type == CONTEXT_TYPE_WEBGL1 && |
+ if (0 && context_type == CONTEXT_TYPE_WEBGL1 && |
DetectWebGL1DepthStencilAttachmentConflicts(need, have)) |
return false; |
return (need & have) != 0; |
@@ -268,7 +268,7 @@ class TextureAttachment |
internal_format == GL_LUMINANCE_ALPHA) { |
return false; |
} |
- if (context_type == CONTEXT_TYPE_WEBGL1 && |
+ if (0 && context_type == CONTEXT_TYPE_WEBGL1 && |
DetectWebGL1DepthStencilAttachmentConflicts(need, have)) |
return need == have; |
return (need & have) != 0; |
@@ -401,6 +401,7 @@ Framebuffer::~Framebuffer() { |
bool Framebuffer::HasUnclearedAttachment( |
GLenum attachment) const { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
AttachmentMap::const_iterator it = |
attachments_.find(attachment); |
if (it != attachments_.end()) { |
@@ -564,6 +565,7 @@ void Framebuffer::MarkAttachmentAsCleared( |
TextureManager* texture_manager, |
GLenum attachment, |
bool cleared) { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
AttachmentMap::iterator it = attachments_.find(attachment); |
if (it != attachments_.end()) { |
Attachment* a = it->second.get(); |
@@ -581,6 +583,7 @@ void Framebuffer::MarkAttachmentsAsCleared( |
bool cleared) { |
for (AttachmentMap::iterator it = attachments_.begin(); |
it != attachments_.end(); ++it) { |
+ DCHECK(it->first != GL_DEPTH_STENCIL_ATTACHMENT); |
Attachment* attachment = it->second.get(); |
if (attachment->cleared() != cleared) { |
attachment->SetCleared(renderbuffer_manager, texture_manager, cleared); |
@@ -593,13 +596,11 @@ bool Framebuffer::HasColorAttachment(int index) const { |
} |
bool Framebuffer::HasDepthAttachment() const { |
- return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
- attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
+ return attachments_.find(GL_DEPTH_ATTACHMENT) != attachments_.end(); |
} |
bool Framebuffer::HasStencilAttachment() const { |
- return attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT) != attachments_.end() || |
- attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
+ return attachments_.find(GL_STENCIL_ATTACHMENT) != attachments_.end(); |
} |
GLenum Framebuffer::GetReadBufferInternalFormat() const { |
@@ -639,9 +640,7 @@ GLsizei Framebuffer::GetSamples() const { |
} |
GLenum Framebuffer::GetDepthFormat() const { |
- auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT); |
- if (iter == attachments_.end()) |
- iter = attachments_.find(GL_DEPTH_ATTACHMENT); |
+ auto iter = attachments_.find(GL_DEPTH_ATTACHMENT); |
if (iter == attachments_.end()) |
return 0; |
Attachment* attachment = iter->second.get(); |
@@ -650,9 +649,7 @@ GLenum Framebuffer::GetDepthFormat() const { |
} |
GLenum Framebuffer::GetStencilFormat() const { |
- auto iter = attachments_.find(GL_DEPTH_STENCIL_ATTACHMENT); |
- if (iter == attachments_.end()) |
- iter = attachments_.find(GL_STENCIL_ATTACHMENT); |
+ auto iter = attachments_.find(GL_STENCIL_ATTACHMENT); |
if (iter == attachments_.end()) |
return 0; |
Attachment* attachment = iter->second.get(); |
@@ -912,6 +909,7 @@ void Framebuffer::DoUnbindGLAttachmentsForWorkaround(GLenum target) { |
void Framebuffer::AttachRenderbuffer( |
GLenum attachment, Renderbuffer* renderbuffer) { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
const Attachment* a = GetAttachment(attachment); |
if (a) |
a->DetachFromFramebuffer(this); |
@@ -927,6 +925,7 @@ void Framebuffer::AttachRenderbuffer( |
void Framebuffer::AttachTexture( |
GLenum attachment, TextureRef* texture_ref, GLenum target, |
GLint level, GLsizei samples) { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
const Attachment* a = GetAttachment(attachment); |
if (a) |
a->DetachFromFramebuffer(this); |
@@ -943,6 +942,7 @@ void Framebuffer::AttachTexture( |
void Framebuffer::AttachTextureLayer( |
GLenum attachment, TextureRef* texture_ref, GLenum target, |
GLint level, GLint layer) { |
+ DCHECK(attachment != GL_DEPTH_STENCIL_ATTACHMENT); |
const Attachment* a = GetAttachment(attachment); |
if (a) |
a->DetachFromFramebuffer(this); |