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

Unified Diff: components/exo/exo_compositor_frame_sink.cc

Issue 2493223002: Change exo::SurfaceFactoryOwner to exo::ExoCompositorFrameSink (Closed)
Patch Set: 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/exo_compositor_frame_sink.h ('k') | components/exo/surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/exo_compositor_frame_sink.cc
diff --git a/components/exo/exo_compositor_frame_sink.cc b/components/exo/exo_compositor_frame_sink.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ef0d1c70510b6b0e73165787df9f2bfd465977f3
--- /dev/null
+++ b/components/exo/exo_compositor_frame_sink.cc
@@ -0,0 +1,48 @@
+// 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/exo_compositor_frame_sink.h"
+
+namespace exo {
+
+////////////////////////////////////////////////////////////////////////////////
+// ExoComopositorFrameSink, public:
+
+ExoComopositorFrameSink::ExoComopositorFrameSink() {}
+
+////////////////////////////////////////////////////////////////////////////////
+// cc::SurfaceFactoryClient overrides:
+
+void ExoComopositorFrameSink::ReturnResources(
+ const cc::ReturnedResourceArray& resources) {
+ scoped_refptr<ExoComopositorFrameSink> holder(this);
+ 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);
+ }
+}
+
+void ExoComopositorFrameSink::WillDrawSurface(const cc::LocalFrameId& id,
+ const gfx::Rect& damage_rect) {
+ if (surface_)
+ surface_->WillDraw();
+}
+
+void ExoComopositorFrameSink::SetBeginFrameSource(
+ cc::BeginFrameSource* begin_frame_source) {
+ if (surface_)
+ surface_->SetBeginFrameSource(begin_frame_source);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ExoComopositorFrameSink, private:
+
+ExoComopositorFrameSink::~ExoComopositorFrameSink() {
+ if (surface_factory_->manager())
+ surface_factory_->manager()->InvalidateFrameSinkId(frame_sink_id_);
+}
+
+} // namespace exo
« no previous file with comments | « components/exo/exo_compositor_frame_sink.h ('k') | components/exo/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698