Index: components/exo/exo_compositor_frame_sink.h |
diff --git a/components/exo/exo_compositor_frame_sink.h b/components/exo/exo_compositor_frame_sink.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..46cc981d3edf2a817753fc2c51e1209bf60a7466 |
--- /dev/null |
+++ b/components/exo/exo_compositor_frame_sink.h |
@@ -0,0 +1,66 @@ |
+// 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 <list> |
+#include <memory> |
+#include <set> |
+#include <utility> |
+ |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/observer_list.h" |
+#include "cc/ipc/compositor_frame.mojom.h" |
+#include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
+#include "cc/resources/transferable_resource.h" |
+#include "cc/scheduler/begin_frame_source.h" |
+#include "cc/surfaces/surface_factory_client.h" |
+#include "mojo/public/cpp/bindings/binding.h" |
+#include "third_party/skia/include/core/SkRegion.h" |
+#include "third_party/skia/include/core/SkXfermode.h" |
+#include "ui/aura/window.h" |
+#include "ui/aura/window_observer.h" |
+#include "ui/gfx/geometry/rect.h" |
+ |
+namespace cc { |
+class SurfaceFactory; |
+} |
+ |
+namespace exo { |
+ |
+class Surface; |
+ |
+class ExoCompositorFrameSink : public base::RefCounted<ExoCompositorFrameSink>, |
+ public cc::SurfaceFactoryClient { |
+ public: |
+ ExoCompositorFrameSink(); |
+ |
+ // Overridden from cc::SurfaceFactoryClient: |
+ void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
+ void WillDrawSurface(const cc::LocalFrameId& id, |
+ const gfx::Rect& damage_rect) override; |
+ void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
+ |
+ // cc::mojom::MojoCompositorFrameSink: |
+ void SetNeedsBeginFrame(bool need_begin_frame) override; |
+ void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
+ |
+ private: |
+ friend class base::RefCounted<ExoCompositorFrameSink>; |
+ friend class Surface; |
+ |
+ ~ExoCompositorFrameSink() override; |
+ |
+ std::map<int, |
+ std::pair<scoped_refptr<ExoCompositorFrameSink>, |
+ std::unique_ptr<cc::SingleReleaseCallback>>> |
+ release_callbacks_; |
+ cc::FrameSinkId frame_sink_id_; |
+ std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; |
+ std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
+ Surface* surface_ = nullptr; |
+}; |
+ |
+} // namespace exo |