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

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

Issue 593233002: Modified GPU command signature hash to use a binary representation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 499 }
500 500
501 // This does not mean the framebuffer is actually complete. It just means our 501 // This does not mean the framebuffer is actually complete. It just means our
502 // checks passed. 502 // checks passed.
503 return GL_FRAMEBUFFER_COMPLETE; 503 return GL_FRAMEBUFFER_COMPLETE;
504 } 504 }
505 505
506 GLenum Framebuffer::GetStatus( 506 GLenum Framebuffer::GetStatus(
507 TextureManager* texture_manager, GLenum target) const { 507 TextureManager* texture_manager, GLenum target) const {
508 // Check if we have this combo already. 508 // Check if we have this combo already.
509 std::string signature; 509 std::string signature;
vmiura 2014/09/23 20:26:47 I think it would help to pre-reserve enough space
David Yen 2014/09/23 20:45:24 Since I will be adding structures for the binary b
510 if (allow_framebuffer_combo_complete_map_) { 510 if (allow_framebuffer_combo_complete_map_) {
511 signature = base::StringPrintf("|FBO|target=%04x", target); 511 signature.append("|Target|");
512 signature.append(reinterpret_cast<const char*>(&target), sizeof(target));
513 signature.push_back('|');
vmiura 2014/09/23 20:26:47 I think we could remove fillers like "|Target|" an
David Yen 2014/09/23 20:45:24 I think it's a good idea to keep marker tags to en
vmiura 2014/09/23 22:37:17 I'd think we need to keep them in the attachments
David Yen 2014/09/23 22:42:51 Done. Removed it in the last patch.
512 for (AttachmentMap::const_iterator it = attachments_.begin(); 514 for (AttachmentMap::const_iterator it = attachments_.begin();
513 it != attachments_.end(); ++it) { 515 it != attachments_.end(); ++it) {
514 Attachment* attachment = it->second.get(); 516 Attachment* attachment = it->second.get();
515 signature += 517 signature.append(reinterpret_cast<const char*>(&it->first),
516 base::StringPrintf("|Attachment|attachmentpoint=%04x", it->first); 518 sizeof(it->first));
517 attachment->AddToSignature(texture_manager, &signature); 519 attachment->AddToSignature(texture_manager, &signature);
518 } 520 }
519 521
520 if (!framebuffer_combo_complete_map_) { 522 if (!framebuffer_combo_complete_map_) {
521 framebuffer_combo_complete_map_ = new FramebufferComboCompleteMap(); 523 framebuffer_combo_complete_map_ = new FramebufferComboCompleteMap();
522 } 524 }
523 525
524 FramebufferComboCompleteMap::const_iterator it = 526 FramebufferComboCompleteMap::const_iterator it =
525 framebuffer_combo_complete_map_->find(signature); 527 framebuffer_combo_complete_map_->find(signature);
526 if (it != framebuffer_combo_complete_map_->end()) { 528 if (it != framebuffer_combo_complete_map_->end()) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 ++it) { 737 ++it) {
736 TextureDetachObserver* observer = *it; 738 TextureDetachObserver* observer = *it;
737 observer->OnTextureRefDetachedFromFramebuffer(texture); 739 observer->OnTextureRefDetachedFromFramebuffer(texture);
738 } 740 }
739 } 741 }
740 742
741 } // namespace gles2 743 } // namespace gles2
742 } // namespace gpu 744 } // namespace gpu
743 745
744 746
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/renderbuffer_manager.cc » ('j') | gpu/command_buffer/service/renderbuffer_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698