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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <bitset> | 10 #include <bitset> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 OFF_VIEWPORT, | 92 OFF_VIEWPORT, |
93 MSAA_CONTENT, | 93 MSAA_CONTENT, |
94 OFF_CONTENT | 94 OFF_CONTENT |
95 }; | 95 }; |
96 | 96 |
97 // LayerTreeHost->Proxy callback interface. | 97 // LayerTreeHost->Proxy callback interface. |
98 class LayerTreeHostImplClient { | 98 class LayerTreeHostImplClient { |
99 public: | 99 public: |
100 virtual void DidLoseCompositorFrameSinkOnImplThread() = 0; | 100 virtual void DidLoseCompositorFrameSinkOnImplThread() = 0; |
101 virtual void SetBeginFrameSource(BeginFrameSource* source) = 0; | 101 virtual void SetBeginFrameSource(BeginFrameSource* source) = 0; |
102 virtual void DidSwapBuffersCompleteOnImplThread() = 0; | 102 virtual void DidReceiveCompositorFrameAckOnImplThread() = 0; |
103 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 103 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
104 virtual void NotifyReadyToActivate() = 0; | 104 virtual void NotifyReadyToActivate() = 0; |
105 virtual void NotifyReadyToDraw() = 0; | 105 virtual void NotifyReadyToDraw() = 0; |
106 // Please call these 2 functions through | 106 // Please call these 2 functions through |
107 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsOneBeginImplFrame(). | 107 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsOneBeginImplFrame(). |
108 virtual void SetNeedsRedrawOnImplThread() = 0; | 108 virtual void SetNeedsRedrawOnImplThread() = 0; |
109 virtual void SetNeedsOneBeginImplFrameOnImplThread() = 0; | 109 virtual void SetNeedsOneBeginImplFrameOnImplThread() = 0; |
110 virtual void SetNeedsCommitOnImplThread() = 0; | 110 virtual void SetNeedsCommitOnImplThread() = 0; |
111 virtual void SetNeedsPrepareTilesOnImplThread() = 0; | 111 virtual void SetNeedsPrepareTilesOnImplThread() = 0; |
112 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; | 112 virtual void SetVideoNeedsBeginFrames(bool needs_begin_frames) = 0; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 gfx::ScrollOffset GetScrollOffsetForAnimation( | 295 gfx::ScrollOffset GetScrollOffsetForAnimation( |
296 ElementId element_id) const override; | 296 ElementId element_id) const override; |
297 | 297 |
298 virtual bool PrepareTiles(); | 298 virtual bool PrepareTiles(); |
299 | 299 |
300 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 300 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
301 // should try to avoid displaying the frame. If PrepareToDraw is called, | 301 // should try to avoid displaying the frame. If PrepareToDraw is called, |
302 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 302 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
303 // called between the two. | 303 // called between the two. |
304 virtual DrawResult PrepareToDraw(FrameData* frame); | 304 virtual DrawResult PrepareToDraw(FrameData* frame); |
305 // TODO(danakj): This isn't "drawing" it's "generating a frame". | |
sunnyps
2016/10/11 18:32:48
aside: I think it's OK for this to be called drawi
danakj
2016/10/13 23:50:22
Done.
| |
305 virtual bool DrawLayers(FrameData* frame); | 306 virtual bool DrawLayers(FrameData* frame); |
306 // Must be called if and only if PrepareToDraw was called. | 307 // Must be called if and only if PrepareToDraw was called. |
307 void DidDrawAllLayers(const FrameData& frame); | 308 void DidDrawAllLayers(const FrameData& frame); |
308 | 309 |
309 const LayerTreeSettings& settings() const { return settings_; } | 310 const LayerTreeSettings& settings() const { return settings_; } |
310 | 311 |
311 // Evict all textures by enforcing a memory policy with an allocation of 0. | 312 // Evict all textures by enforcing a memory policy with an allocation of 0. |
312 void EvictTexturesForTesting(); | 313 void EvictTexturesForTesting(); |
313 | 314 |
314 // When blocking, this prevents client_->NotifyReadyToActivate() from being | 315 // When blocking, this prevents client_->NotifyReadyToActivate() from being |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 // VideoBeginFrameSource implementation. | 359 // VideoBeginFrameSource implementation. |
359 void AddVideoFrameController(VideoFrameController* controller) override; | 360 void AddVideoFrameController(VideoFrameController* controller) override; |
360 void RemoveVideoFrameController(VideoFrameController* controller) override; | 361 void RemoveVideoFrameController(VideoFrameController* controller) override; |
361 | 362 |
362 // CompositorFrameSinkClient implementation. | 363 // CompositorFrameSinkClient implementation. |
363 void SetBeginFrameSource(BeginFrameSource* source) override; | 364 void SetBeginFrameSource(BeginFrameSource* source) override; |
364 void SetExternalTilePriorityConstraints( | 365 void SetExternalTilePriorityConstraints( |
365 const gfx::Rect& viewport_rect, | 366 const gfx::Rect& viewport_rect, |
366 const gfx::Transform& transform) override; | 367 const gfx::Transform& transform) override; |
367 void DidLoseCompositorFrameSink() override; | 368 void DidLoseCompositorFrameSink() override; |
368 void DidSwapBuffersComplete() override; | 369 void DidReceiveCompositorFrameAck() override; |
369 void ReclaimResources(const ReturnedResourceArray& resources) override; | 370 void ReclaimResources(const ReturnedResourceArray& resources) override; |
370 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 371 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
371 void SetTreeActivationCallback(const base::Closure& callback) override; | 372 void SetTreeActivationCallback(const base::Closure& callback) override; |
372 void OnDraw(const gfx::Transform& transform, | 373 void OnDraw(const gfx::Transform& transform, |
373 const gfx::Rect& viewport, | 374 const gfx::Rect& viewport, |
374 bool resourceless_software_draw) override; | 375 bool resourceless_software_draw) override; |
375 | 376 |
376 // LayerTreeMutatorClient. | 377 // LayerTreeMutatorClient. |
377 void SetNeedsMutate() override; | 378 void SetNeedsMutate() override; |
378 | 379 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 | 838 |
838 std::unique_ptr<PendingTreeDurationHistogramTimer> | 839 std::unique_ptr<PendingTreeDurationHistogramTimer> |
839 pending_tree_duration_timer_; | 840 pending_tree_duration_timer_; |
840 | 841 |
841 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 842 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
842 }; | 843 }; |
843 | 844 |
844 } // namespace cc | 845 } // namespace cc |
845 | 846 |
846 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 847 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |