OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 "base/memory/scoped_ptr.h" | |
6 | |
7 #include "cc/layers/delegated_frame_resource_collection.h" | |
8 #include "cc/layers/delegated_renderer_layer.h" | |
9 #include "cc/output/output_surface_client.h" | |
10 #include "cc/surfaces/surface_aggregator.h" | |
11 #include "cc/surfaces/surface_client.h" | |
12 #include "cc/surfaces/surfaces_export.h" | |
13 #include "cc/trees/layer_tree_host_client.h" | |
14 #include "cc/trees/layer_tree_host_single_thread_client.h" | |
15 | |
16 namespace gfx { | |
17 class Size; | |
18 } | |
19 | |
20 namespace cc { | |
21 | |
22 class DirectRenderer; | |
23 class DisplayClient; | |
24 class LayerTreeHost; | |
25 class OutputSurface; | |
26 class ResourceProvider; | |
27 class Surface; | |
28 class SurfaceManager; | |
29 | |
30 class CC_SURFACES_EXPORT Display | |
31 : public SurfaceClient, | |
32 public DelegatedFrameResourceCollectionClient, | |
33 NON_EXPORTED_BASE(public LayerTreeHostClient), | |
34 NON_EXPORTED_BASE(public LayerTreeHostSingleThreadClient) { | |
35 public: | |
36 Display(DisplayClient* client, SurfaceManager* manager); | |
37 virtual ~Display(); | |
38 | |
39 void Resize(const gfx::Size& new_size); | |
jamesr
2014/05/28 23:15:47
guessing we'll want a scale factor too here someda
| |
40 bool Draw(); | |
41 | |
42 int CurrentSurfaceID(); | |
43 | |
44 // LayerTreeHostClient implementation. | |
45 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | |
46 virtual void DidBeginMainFrame() OVERRIDE {} | |
47 virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE {} | |
48 virtual void Layout() OVERRIDE {} | |
49 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, | |
50 float page_scale) OVERRIDE {} | |
51 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE; | |
52 virtual void DidInitializeOutputSurface() OVERRIDE {} | |
53 virtual void WillCommit() OVERRIDE {} | |
54 virtual void DidCommit() OVERRIDE {} | |
55 virtual void DidCommitAndDrawFrame() OVERRIDE {} | |
56 virtual void DidCompleteSwapBuffers() OVERRIDE {} | |
57 | |
58 // LayerTreeHostSingleThreadClient implementation. | |
59 virtual void ScheduleComposite() OVERRIDE; | |
60 virtual void ScheduleAnimation() OVERRIDE { ScheduleComposite(); } | |
61 virtual void DidPostSwapBuffers() OVERRIDE {} | |
62 virtual void DidAbortSwapBuffers() OVERRIDE {} | |
63 | |
64 // DelegatedFrameResourceCollectionClient implementation. | |
65 virtual void UnusedResourcesAreAvailable() OVERRIDE {} | |
66 | |
67 // SurfaceClient implementation. | |
68 virtual void ReturnResources(const ReturnedResourceArray& resources) OVERRIDE; | |
69 | |
70 private: | |
71 void DoComposite(); | |
72 | |
73 bool scheduled_draw_; | |
74 | |
75 DisplayClient* client_; | |
76 SurfaceManager* manager_; | |
77 SurfaceAggregator aggregator_; | |
78 scoped_ptr<Surface> current_surface_; | |
79 scoped_ptr<LayerTreeHost> layer_tree_host_; | |
80 scoped_refptr<DelegatedFrameResourceCollection> resource_collection_; | |
81 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; | |
82 scoped_refptr<DelegatedRendererLayer> delegated_layer_; | |
83 | |
84 DISALLOW_COPY_AND_ASSIGN(Display); | |
85 }; | |
86 | |
87 } // namespace cc | |
OLD | NEW |