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

Side by Side Diff: gpu/command_buffer/service/framebuffer_manager.cc

Issue 896303004: gpu: Workaround Adreno 420 bug with deleting current FBO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/renderbuffer_manager.h" 9 #include "gpu/command_buffer/service/renderbuffer_manager.h"
10 #include "gpu/command_buffer/service/texture_manager.h" 10 #include "gpu/command_buffer/service/texture_manager.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 } 624 }
625 625
626 void FramebufferManager::RemoveFramebuffer(GLuint client_id) { 626 void FramebufferManager::RemoveFramebuffer(GLuint client_id) {
627 FramebufferMap::iterator it = framebuffers_.find(client_id); 627 FramebufferMap::iterator it = framebuffers_.find(client_id);
628 if (it != framebuffers_.end()) { 628 if (it != framebuffers_.end()) {
629 it->second->MarkAsDeleted(); 629 it->second->MarkAsDeleted();
630 framebuffers_.erase(it); 630 framebuffers_.erase(it);
631 } 631 }
632 } 632 }
633 633
634 void Framebuffer::UnbindAttachments(GLenum target) {
635 // Replace all attachments with the default Renderbuffer.
636 for (AttachmentMap::const_iterator it = attachments_.begin();
637 it != attachments_.end(); ++it) {
638 AttachRenderbuffer(it->first, NULL);
vmiura 2015/02/17 21:48:48 Hmm, I'm getting some GL errors after doing this s
639 glFramebufferRenderbufferEXT(target, it->first, GL_RENDERBUFFER, 0);
640 }
641 }
642
634 void Framebuffer::AttachRenderbuffer( 643 void Framebuffer::AttachRenderbuffer(
635 GLenum attachment, Renderbuffer* renderbuffer) { 644 GLenum attachment, Renderbuffer* renderbuffer) {
636 const Attachment* a = GetAttachment(attachment); 645 const Attachment* a = GetAttachment(attachment);
637 if (a) 646 if (a)
638 a->DetachFromFramebuffer(this); 647 a->DetachFromFramebuffer(this);
639 if (renderbuffer) { 648 if (renderbuffer) {
640 attachments_[attachment] = scoped_refptr<Attachment>( 649 attachments_[attachment] = scoped_refptr<Attachment>(
641 new RenderbufferAttachment(renderbuffer)); 650 new RenderbufferAttachment(renderbuffer));
642 } else { 651 } else {
643 attachments_.erase(attachment); 652 attachments_.erase(attachment);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 ++it) { 742 ++it) {
734 TextureDetachObserver* observer = *it; 743 TextureDetachObserver* observer = *it;
735 observer->OnTextureRefDetachedFromFramebuffer(texture); 744 observer->OnTextureRefDetachedFromFramebuffer(texture);
736 } 745 }
737 } 746 }
738 747
739 } // namespace gles2 748 } // namespace gles2
740 } // namespace gpu 749 } // namespace gpu
741 750
742 751
OLDNEW
« 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