OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <list> |
| 6 #include <memory> |
| 7 #include <set> |
| 8 #include <utility> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" |
| 15 #include "cc/ipc/compositor_frame.mojom.h" |
| 16 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
| 17 #include "cc/resources/transferable_resource.h" |
| 18 #include "cc/scheduler/begin_frame_source.h" |
| 19 #include "cc/surfaces/surface_factory_client.h" |
| 20 #include "mojo/public/cpp/bindings/binding.h" |
| 21 #include "third_party/skia/include/core/SkRegion.h" |
| 22 #include "third_party/skia/include/core/SkXfermode.h" |
| 23 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_observer.h" |
| 25 #include "ui/gfx/geometry/rect.h" |
| 26 |
| 27 namespace cc { |
| 28 class SurfaceFactory; |
| 29 } |
| 30 |
| 31 namespace exo { |
| 32 |
| 33 class Surface; |
| 34 |
| 35 class ExoCompositorFrameSink : public base::RefCounted<ExoCompositorFrameSink>, |
| 36 public cc::SurfaceFactoryClient { |
| 37 public: |
| 38 ExoCompositorFrameSink(); |
| 39 |
| 40 // Overridden from cc::SurfaceFactoryClient: |
| 41 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 42 void WillDrawSurface(const cc::LocalFrameId& id, |
| 43 const gfx::Rect& damage_rect) override; |
| 44 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 45 |
| 46 // cc::mojom::MojoCompositorFrameSink: |
| 47 void SetNeedsBeginFrame(bool need_begin_frame) override; |
| 48 void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
| 49 |
| 50 private: |
| 51 friend class base::RefCounted<ExoCompositorFrameSink>; |
| 52 friend class Surface; |
| 53 |
| 54 ~ExoCompositorFrameSink() override; |
| 55 |
| 56 std::map<int, |
| 57 std::pair<scoped_refptr<ExoCompositorFrameSink>, |
| 58 std::unique_ptr<cc::SingleReleaseCallback>>> |
| 59 release_callbacks_; |
| 60 cc::FrameSinkId frame_sink_id_; |
| 61 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; |
| 62 std::unique_ptr<cc::SurfaceFactory> surface_factory_; |
| 63 Surface* surface_ = nullptr; |
| 64 }; |
| 65 |
| 66 } // namespace exo |
OLD | NEW |