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

Unified Diff: components/exo/surface.cc

Issue 2452523002: exo: Add zcr_linux_explicit_synchronization_v1
Patch Set: Created 4 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 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 8c0efb7909a8aede879c2c828d69e6f4c72479b5..900f01431fb2be5dccdbfaaf04d54fd4543b7137 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"
@@ -261,6 +262,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());
@@ -467,6 +474,7 @@ void Surface::CommitSurfaceHierarchy() {
has_pending_contents_ = false;
current_buffer_ = std::move(pending_buffer_);
+ fence_ = std::move(pending_fence_);
UpdateResource(true);
}
@@ -716,8 +724,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