OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "cc/animation/animation_events.h" | 14 #include "cc/animation/animation_events.h" |
15 #include "cc/animation/animation_registrar.h" | 15 #include "cc/animation/animation_registrar.h" |
16 #include "cc/base/cc_export.h" | 16 #include "cc/base/cc_export.h" |
17 #include "cc/input/input_handler.h" | 17 #include "cc/input/input_handler.h" |
18 #include "cc/input/layer_scroll_offset_delegate.h" | 18 #include "cc/input/layer_scroll_offset_delegate.h" |
19 #include "cc/input/top_controls_manager_client.h" | 19 #include "cc/input/top_controls_manager_client.h" |
20 #include "cc/layers/layer_lists.h" | 20 #include "cc/layers/layer_lists.h" |
21 #include "cc/layers/render_pass_sink.h" | 21 #include "cc/layers/render_pass_sink.h" |
22 #include "cc/output/output_surface_client.h" | 22 #include "cc/output/output_surface_client.h" |
23 #include "cc/output/renderer.h" | 23 #include "cc/output/renderer.h" |
24 #include "cc/quads/render_pass.h" | 24 #include "cc/quads/render_pass.h" |
25 #include "cc/resources/tile_manager.h" | 25 #include "cc/resources/tile_manager.h" |
26 #include "skia/ext/refptr.h" | 26 #include "skia/ext/refptr.h" |
27 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
28 #include "third_party/skia/include/core/SkPicture.h" | 28 #include "third_party/skia/include/core/SkPicture.h" |
29 #include "ui/base/latency_info.h" | |
30 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
31 | 30 |
32 namespace cc { | 31 namespace cc { |
33 | 32 |
34 class CompletionEvent; | 33 class CompletionEvent; |
35 class CompositorFrameMetadata; | 34 class CompositorFrameMetadata; |
36 class DebugRectHistory; | 35 class DebugRectHistory; |
37 class FrameRateCounter; | 36 class FrameRateCounter; |
38 class LayerImpl; | 37 class LayerImpl; |
39 class LayerTreeHostImplTimeSourceAdapter; | 38 class LayerTreeHostImplTimeSourceAdapter; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 virtual ~FrameData(); | 136 virtual ~FrameData(); |
138 | 137 |
139 std::vector<gfx::Rect> occluding_screen_space_rects; | 138 std::vector<gfx::Rect> occluding_screen_space_rects; |
140 std::vector<gfx::Rect> non_occluding_screen_space_rects; | 139 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
141 RenderPassList render_passes; | 140 RenderPassList render_passes; |
142 RenderPassIdHashMap render_passes_by_id; | 141 RenderPassIdHashMap render_passes_by_id; |
143 const LayerImplList* render_surface_layer_list; | 142 const LayerImplList* render_surface_layer_list; |
144 LayerImplList will_draw_layers; | 143 LayerImplList will_draw_layers; |
145 bool contains_incomplete_tile; | 144 bool contains_incomplete_tile; |
146 bool has_no_damage; | 145 bool has_no_damage; |
147 ui::LatencyInfo latency_info; | |
148 | 146 |
149 // RenderPassSink implementation. | 147 // RenderPassSink implementation. |
150 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; | 148 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; |
151 }; | 149 }; |
152 | 150 |
153 virtual void BeginCommit(); | 151 virtual void BeginCommit(); |
154 virtual void CommitComplete(); | 152 virtual void CommitComplete(); |
155 virtual void Animate(base::TimeTicks monotonic_time, | 153 virtual void Animate(base::TimeTicks monotonic_time, |
156 base::Time wall_clock_time); | 154 base::Time wall_clock_time); |
157 virtual void UpdateAnimationState(bool start_ready_animations); | 155 virtual void UpdateAnimationState(bool start_ready_animations); |
(...skipping 19 matching lines...) Expand all Loading... |
177 // the URL bar and non-overlay scrollbars. | 175 // the URL bar and non-overlay scrollbars. |
178 gfx::SizeF VisibleViewportSize() const; | 176 gfx::SizeF VisibleViewportSize() const; |
179 | 177 |
180 // RendererClient implementation | 178 // RendererClient implementation |
181 virtual gfx::Rect DeviceViewport() const OVERRIDE; | 179 virtual gfx::Rect DeviceViewport() const OVERRIDE; |
182 private: | 180 private: |
183 virtual float DeviceScaleFactor() const OVERRIDE; | 181 virtual float DeviceScaleFactor() const OVERRIDE; |
184 virtual const LayerTreeSettings& Settings() const OVERRIDE; | 182 virtual const LayerTreeSettings& Settings() const OVERRIDE; |
185 public: | 183 public: |
186 virtual void DidLoseOutputSurface() OVERRIDE; | 184 virtual void DidLoseOutputSurface() OVERRIDE; |
187 virtual void OnSwapBuffersComplete() OVERRIDE; | 185 virtual void OnSwapBuffersComplete(const CompositorFrameAck* ack) OVERRIDE; |
188 virtual void SetFullRootLayerDamage() OVERRIDE; | 186 virtual void SetFullRootLayerDamage() OVERRIDE; |
189 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 187 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
190 OVERRIDE; | 188 OVERRIDE; |
191 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 189 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
192 OVERRIDE; | 190 OVERRIDE; |
193 virtual bool HasImplThread() const OVERRIDE; | 191 virtual bool HasImplThread() const OVERRIDE; |
194 virtual bool ShouldClearRootRenderPass() const OVERRIDE; | 192 virtual bool ShouldClearRootRenderPass() const OVERRIDE; |
195 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; | 193 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; |
196 virtual bool AllowPartialSwap() const OVERRIDE; | 194 virtual bool AllowPartialSwap() const OVERRIDE; |
197 | 195 |
198 // TileManagerClient implementation. | 196 // TileManagerClient implementation. |
199 virtual void DidInitializeVisibleTile() OVERRIDE; | 197 virtual void DidInitializeVisibleTile() OVERRIDE; |
200 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const | 198 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const |
201 OVERRIDE; | 199 OVERRIDE; |
202 | 200 |
203 // OutputSurfaceClient implementation. | 201 // OutputSurfaceClient implementation. |
204 virtual bool DeferredInitialize( | 202 virtual bool DeferredInitialize( |
205 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; | 203 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; |
206 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; | 204 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; |
207 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 205 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
208 base::TimeDelta interval) OVERRIDE; | 206 base::TimeDelta interval) OVERRIDE; |
209 virtual void BeginFrame(base::TimeTicks frame_time) | 207 virtual void BeginFrame(base::TimeTicks frame_time) |
210 OVERRIDE; | 208 OVERRIDE; |
211 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) | |
212 OVERRIDE; | |
213 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, | 209 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, |
214 gfx::Rect viewport) OVERRIDE; | 210 gfx::Rect viewport) OVERRIDE; |
215 | 211 |
216 // Called from LayerTreeImpl. | 212 // Called from LayerTreeImpl. |
217 void OnCanDrawStateChangedForTree(); | 213 void OnCanDrawStateChangedForTree(); |
218 | 214 |
219 // Implementation | 215 // Implementation |
220 bool CanDraw(); | 216 bool CanDraw(); |
221 OutputSurface* output_surface() const { return output_surface_.get(); } | 217 OutputSurface* output_surface() const { return output_surface_.get(); } |
222 | 218 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 scoped_ptr<AnimationRegistrar> animation_registrar_; | 529 scoped_ptr<AnimationRegistrar> animation_registrar_; |
534 | 530 |
535 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 531 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
536 | 532 |
537 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 533 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
538 }; | 534 }; |
539 | 535 |
540 } // namespace cc | 536 } // namespace cc |
541 | 537 |
542 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 538 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |