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

Side by Side Diff: components/exo/surface.cc

Issue 2584953002: exo::CompositorFrameSinkHolder's release callbacks hold ref (Closed)
Patch Set: NOT FOR COMMIT: Buffer references sink_holder Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/surface.h" 5 #include "components/exo/surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 658 }
659 659
660 void Surface::UpdateResource(bool client_usage) { 660 void Surface::UpdateResource(bool client_usage) {
661 std::unique_ptr<cc::SingleReleaseCallback> texture_mailbox_release_callback; 661 std::unique_ptr<cc::SingleReleaseCallback> texture_mailbox_release_callback;
662 662
663 cc::TextureMailbox texture_mailbox; 663 cc::TextureMailbox texture_mailbox;
664 if (current_buffer_.buffer()) { 664 if (current_buffer_.buffer()) {
665 texture_mailbox_release_callback = 665 texture_mailbox_release_callback =
666 current_buffer_.buffer()->ProduceTextureMailbox( 666 current_buffer_.buffer()->ProduceTextureMailbox(
667 &texture_mailbox, state_.only_visible_on_secure_output, 667 &texture_mailbox, state_.only_visible_on_secure_output,
668 client_usage); 668 client_usage, compositor_frame_sink_holder_.get());
669 } 669 }
670 670
671 if (texture_mailbox_release_callback) { 671 if (texture_mailbox_release_callback) {
672 cc::TransferableResource resource; 672 cc::TransferableResource resource;
673 resource.id = next_resource_id_++; 673 resource.id = next_resource_id_++;
674 resource.format = cc::RGBA_8888; 674 resource.format = cc::RGBA_8888;
675 resource.filter = 675 resource.filter =
676 texture_mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR; 676 texture_mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR;
677 resource.size = texture_mailbox.size_in_pixels(); 677 resource.size = texture_mailbox.size_in_pixels();
678 resource.mailbox_holder = gpu::MailboxHolder(texture_mailbox.mailbox(), 678 resource.mailbox_holder = gpu::MailboxHolder(texture_mailbox.mailbox(),
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 int64_t Surface::GetPropertyInternal(const void* key, 796 int64_t Surface::GetPropertyInternal(const void* key,
797 int64_t default_value) const { 797 int64_t default_value) const {
798 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); 798 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key);
799 if (iter == prop_map_.end()) 799 if (iter == prop_map_.end())
800 return default_value; 800 return default_value;
801 return iter->second.value; 801 return iter->second.value;
802 } 802 }
803 803
804 } // namespace exo 804 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698