Chromium Code Reviews| 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 4022b3defaa1e286e85e72f7ac6aa702fa1e9fb2..46d9f4147cfda7b4bc91122ae88d3341f0c25771 100644 |
| --- a/gpu/command_buffer/service/framebuffer_manager.cc |
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc |
| @@ -113,6 +113,11 @@ class RenderbufferAttachment |
| return renderbuffer_.get(); |
| } |
| + virtual size_t GetSignatureSize( |
| + TextureManager* texture_manager) const OVERRIDE { |
| + return renderbuffer_->GetSignatureSize(); |
| + } |
| + |
| virtual void AddToSignature( |
| TextureManager* texture_manager, std::string* signature) const OVERRIDE { |
| DCHECK(signature); |
| @@ -239,6 +244,11 @@ class TextureAttachment |
| return (need & have) != 0; |
| } |
| + virtual size_t GetSignatureSize( |
| + TextureManager* texture_manager) const OVERRIDE { |
| + return texture_manager->GetSignatureSize(); |
| + } |
| + |
| virtual void AddToSignature( |
| TextureManager* texture_manager, std::string* signature) const OVERRIDE { |
| DCHECK(signature); |
| @@ -508,12 +518,22 @@ GLenum Framebuffer::GetStatus( |
| // Check if we have this combo already. |
| std::string signature; |
| if (allow_framebuffer_combo_complete_map_) { |
| - signature = base::StringPrintf("|FBO|target=%04x", target); |
| + size_t signature_size = sizeof(target); |
| + for (AttachmentMap::const_iterator it = attachments_.begin(); |
| + it != attachments_.end(); ++it) { |
| + Attachment* attachment = it->second.get(); |
| + signature_size += sizeof(it->first) + |
| + attachment->GetSignatureSize(texture_manager); |
| + } |
| + |
| + signature.reserve(signature_size); |
| + signature.append(reinterpret_cast<const char*>(&target), sizeof(target)); |
| + |
| for (AttachmentMap::const_iterator it = attachments_.begin(); |
| it != attachments_.end(); ++it) { |
| Attachment* attachment = it->second.get(); |
| - signature += |
| - base::StringPrintf("|Attachment|attachmentpoint=%04x", it->first); |
| + signature.append(reinterpret_cast<const char*>(&it->first), |
| + sizeof(it->first)); |
| attachment->AddToSignature(texture_manager, &signature); |
| } |
|
vmiura
2014/09/26 23:36:36
nit: DCHECK(signature.size() == signature_size) wi
David Yen
2014/09/29 16:42:58
Good idea. Done.
|
| @@ -565,8 +585,6 @@ void Framebuffer::SetDrawBuffers(GLsizei n, const GLenum* bufs) { |
| draw_buffers_[i] = bufs[i]; |
| } |
| - |
| - |
| bool Framebuffer::HasAlphaMRT() const { |
| for (uint32 i = 0; i < manager_->max_draw_buffers_; ++i) { |
| if (draw_buffers_[i] != GL_NONE) { |