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 #ifndef COMPONENTS_EXO_EXO_COMPOSITOR_FRAME_SINK_H_ | |
6 #define COMPONENTS_EXO_EXO_COMPOSITOR_FRAME_SINK_H_ | |
7 | |
8 #include <list> | |
Fady Samuel
2016/11/23 14:39:02
I suspect you don't need this.
Alex Z.
2016/11/23 15:27:41
Done.
| |
9 #include <memory> | |
10 #include <set> | |
Fady Samuel
2016/11/23 14:39:02
I suspect you don't need this.
Alex Z.
2016/11/23 15:27:40
Done.
| |
11 #include <utility> | |
12 | |
13 #include "base/callback.h" | |
14 #include "base/macros.h" | |
15 #include "base/memory/ref_counted.h" | |
Fady Samuel
2016/11/23 14:39:02
You don't need this.
Alex Z.
2016/11/23 15:27:40
Done.
| |
16 #include "base/memory/weak_ptr.h" | |
17 #include "base/observer_list.h" | |
Fady Samuel
2016/11/23 14:39:02
I suspect you don't need this.
Alex Z.
2016/11/23 15:27:41
Done.
| |
18 #include "cc/ipc/compositor_frame.mojom.h" | |
19 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | |
20 #include "cc/resources/transferable_resource.h" | |
21 #include "cc/scheduler/begin_frame_source.h" | |
22 #include "cc/surfaces/surface_factory.h" | |
23 #include "cc/surfaces/surface_factory_client.h" | |
24 #include "cc/surfaces/surface_id_allocator.h" | |
Fady Samuel
2016/11/23 14:39:02
You don't need surface_id_allocator.h
Alex Z.
2016/11/23 15:27:41
Done.
| |
25 #include "mojo/public/cpp/bindings/binding.h" | |
26 #include "third_party/skia/include/core/SkRegion.h" | |
27 #include "third_party/skia/include/core/SkXfermode.h" | |
Fady Samuel
2016/11/23 14:39:03
I don't think you need third_party/skia.
Alex Z.
2016/11/23 15:27:41
Done.
| |
28 #include "ui/aura/window.h" | |
29 #include "ui/aura/window_observer.h" | |
Fady Samuel
2016/11/23 14:39:02
You don't need to depend on aura here.
Alex Z.
2016/11/23 15:27:40
Done.
| |
30 #include "ui/gfx/geometry/rect.h" | |
31 | |
32 namespace cc { | |
33 class SurfaceFactory; | |
34 } | |
35 | |
36 namespace exo { | |
37 class CompositorFrameSinkHolder; | |
Fady Samuel
2016/11/23 14:39:02
remove this.
Alex Z.
2016/11/23 15:27:40
Done.
| |
38 | |
39 // This class owns the SurfaceFactory and keeps track of references to the | |
40 // contents of Buffers. It's keeped alive by references from | |
41 // release_callbacks_. It's destroyed when its owning Surface is destroyed and | |
42 // the last outstanding release callback is called. | |
43 class ExoCompositorFrameSink : public cc::SurfaceFactoryClient, | |
44 public cc::BeginFrameObserver { | |
45 public: | |
46 ExoCompositorFrameSink(const cc::FrameSinkId& frame_sink_id, | |
47 cc::SurfaceManager* surface_manager, | |
48 cc::mojom::MojoCompositorFrameSinkClientPtr client); | |
49 | |
50 ~ExoCompositorFrameSink() override; | |
51 | |
52 // To be cc::mojom::MojoCompositorFrameSink: | |
Fady Samuel
2016/11/23 14:39:02
Make this cc::mojom::MojoCompositorFrameSink now?
Alex Z.
2016/11/23 15:27:40
Done.
| |
53 void SubmitCompositorFrame(const cc::LocalFrameId& local_frame_id, | |
54 cc::CompositorFrame frame); | |
55 | |
56 private: | |
57 friend class base::RefCounted<ExoCompositorFrameSink>; | |
Fady Samuel
2016/11/23 14:39:02
remove this.
Alex Z.
2016/11/23 15:27:41
Done.
| |
58 | |
59 void UpdateNeedsBeginFrameInternal(); | |
60 void DidReceiveCompositorFrameAck(); | |
61 | |
62 // cc::SurfaceFactoryClient: | |
63 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
64 void WillDrawSurface(const cc::LocalFrameId& id, | |
65 const gfx::Rect& damage_rect) override; | |
66 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | |
67 | |
68 // cc::BeginFrameObserver: | |
69 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | |
70 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | |
71 void OnBeginFrameSourcePausedChanged(bool paused) override; | |
72 | |
73 const cc::FrameSinkId frame_sink_id_; | |
74 cc::LocalFrameId last_local_frame_id_; | |
75 | |
76 cc::SurfaceManager* surface_manager_; | |
77 cc::SurfaceFactory surface_factory_; | |
78 | |
79 cc::mojom::MojoCompositorFrameSinkClientPtr client_; | |
80 | |
81 int ack_pending_count_ = 0; | |
82 cc::ReturnedResourceArray surface_returned_resources_; | |
83 | |
84 cc::BeginFrameSource* begin_frame_source_ = nullptr; | |
85 | |
86 gfx::Size last_submitted_frame_size_; | |
87 | |
88 cc::BeginFrameArgs last_begin_frame_args_; | |
89 | |
90 bool needs_begin_frame_ = false; | |
91 bool added_frame_observer_ = false; | |
92 | |
93 DISALLOW_COPY_AND_ASSIGN(ExoCompositorFrameSink); | |
94 }; | |
95 | |
96 } // namespace exo | |
97 | |
98 #endif // COMPONENTS_EXO_EXO_COMPOSITOR_FRAME_SINK_H_ | |
OLD | NEW |