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

Unified Diff: components/exo/compositor_frame_sink_holder.cc

Issue 2493223002: Change exo::SurfaceFactoryOwner to exo::ExoCompositorFrameSink (Closed)
Patch Set: Updated DEPS rules to address errors in trybots' analyze step 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
Index: components/exo/compositor_frame_sink_holder.cc
diff --git a/components/exo/compositor_frame_sink_holder.cc b/components/exo/compositor_frame_sink_holder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..032db507715ef7d223b6d0549556b03668f3afae
--- /dev/null
+++ b/components/exo/compositor_frame_sink_holder.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/exo/compositor_frame_sink_holder.h"
+
+#include "cc/resources/returned_resource.h"
+
+namespace exo {
+
+////////////////////////////////////////////////////////////////////////////////
+// CompositorFrameSinkHolder, public:
+CompositorFrameSinkHolder::CompositorFrameSinkHolder(
+ cc::mojom::MojoCompositorFrameSinkClientRequest request)
+ : binding_(this, std::move(request)) {}
+
+bool CompositorFrameSinkHolder::HasReleaseCallbacks(cc::ResourceId id) {
+ return release_callbacks_.count(id);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// cc::SurfaceFactoryClient overrides:
+
+// TODO(staraz): Implement this
+void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() {}
+
+// TODO(staraz): Implement this
+void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) {}
+
+void CompositorFrameSinkHolder::ReclaimResources(
+ const cc::ReturnedResourceArray& resources) {
+ for (auto& resource : resources) {
+ auto it = release_callbacks_.find(resource.id);
+ DCHECK(it != release_callbacks_.end());
+ it->second.second->Run(resource.sync_token, resource.lost);
+ release_callbacks_.erase(it);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ExoComopositorFrameSink, private:
+CompositorFrameSinkHolder::~CompositorFrameSinkHolder() {}
+
+} // namespace exo

Powered by Google App Engine
This is Rietveld 408576698