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

Unified Diff: components/exo/surface.cc

Issue 2404513002: exo: Implement zcr_linux_explicit_synchronization_v1
Patch Set: rebase, pull in cl 2443823002 Created 4 years, 1 month 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
« no previous file with comments | « components/exo/surface.h ('k') | components/exo/wayland/BUILD.gn » ('j') | 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 7e71e43d8d241d7c5bb875395975de148260f707..781df4eae7bedeffc8b8b21ec89b2877a715ae22 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -36,6 +36,7 @@
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/geometry/safe_integer_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
+#include "ui/gfx/gpu_fence.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/path.h"
#include "ui/gfx/skia_util.h"
@@ -260,6 +261,12 @@ void Surface::Attach(Buffer* buffer) {
pending_buffer_.Reset(buffer ? buffer->AsWeakPtr() : base::WeakPtr<Buffer>());
}
+void Surface::SetAcquireFence(std::unique_ptr<gfx::GpuFence> fence) {
+ TRACE_EVENT1("exo", "Surface::FenceAcquire", "fence", !!fence);
+
+ pending_fence_ = std::move(fence);
+}
+
void Surface::Damage(const gfx::Rect& damage) {
TRACE_EVENT1("exo", "Surface::Damage", "damage", damage.ToString());
@@ -466,6 +473,7 @@ void Surface::CommitSurfaceHierarchy() {
has_pending_contents_ = false;
current_buffer_ = std::move(pending_buffer_);
+ fence_ = std::move(pending_fence_);
UpdateResource(true);
}
@@ -693,8 +701,8 @@ void Surface::UpdateResource(bool client_usage) {
if (current_buffer_.buffer()) {
texture_mailbox_release_callback =
current_buffer_.buffer()->ProduceTextureMailbox(
- &texture_mailbox, state_.only_visible_on_secure_output,
- client_usage);
+ &texture_mailbox, fence_.get(),
+ state_.only_visible_on_secure_output, client_usage);
}
if (texture_mailbox_release_callback) {
« no previous file with comments | « components/exo/surface.h ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698