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

Unified Diff: components/exo/surface.cc

Issue 2584953002: exo::CompositorFrameSinkHolder's release callbacks hold ref (Closed)
Patch Set: Addressed comments Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« components/exo/buffer.cc ('K') | « components/exo/compositor_frame_sink_holder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index 6c811518935b3c3ac30a69eb16aaab2eeef55442..e2f8d4af850622364dc6a20be45be253c9d2eb98 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -658,32 +658,11 @@ void Surface::SetSurfaceHierarchyNeedsCommitToNewSurfaces() {
}
void Surface::UpdateResource(bool client_usage) {
- std::unique_ptr<cc::SingleReleaseCallback> texture_mailbox_release_callback;
-
- cc::TextureMailbox texture_mailbox;
- if (current_buffer_.buffer()) {
- texture_mailbox_release_callback =
- current_buffer_.buffer()->ProduceTextureMailbox(
- &texture_mailbox, state_.only_visible_on_secure_output,
- client_usage);
- }
-
- if (texture_mailbox_release_callback) {
- cc::TransferableResource resource;
- resource.id = next_resource_id_++;
- resource.format = cc::RGBA_8888;
- resource.filter =
- texture_mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR;
- resource.size = texture_mailbox.size_in_pixels();
- resource.mailbox_holder = gpu::MailboxHolder(texture_mailbox.mailbox(),
- texture_mailbox.sync_token(),
- texture_mailbox.target());
- resource.is_overlay_candidate = texture_mailbox.is_overlay_candidate();
-
- compositor_frame_sink_holder_->AddResourceReleaseCallback(
- resource.id, std::move(texture_mailbox_release_callback));
- current_resource_ = resource;
- } else {
+ if (!current_buffer_.buffer() ||
+ !current_buffer_.buffer()->ProduceTransferableResource(
+ compositor_frame_sink_holder_.get(), next_resource_id_++,
+ state_.only_visible_on_secure_output, client_usage,
+ &current_resource_)) {
current_resource_.id = 0;
current_resource_.size = gfx::Size();
}
« components/exo/buffer.cc ('K') | « components/exo/compositor_frame_sink_holder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698