| 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 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void NotifyReadyToActivate() override { | 134 void NotifyReadyToActivate() override { |
| 135 did_notify_ready_to_activate_ = true; | 135 did_notify_ready_to_activate_ = true; |
| 136 host_impl_->ActivateSyncTree(); | 136 host_impl_->ActivateSyncTree(); |
| 137 } | 137 } |
| 138 void NotifyReadyToDraw() override {} | 138 void NotifyReadyToDraw() override {} |
| 139 void SetNeedsRedrawOnImplThread() override { did_request_redraw_ = true; } | 139 void SetNeedsRedrawOnImplThread() override { did_request_redraw_ = true; } |
| 140 void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override { | 140 void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override { |
| 141 did_request_redraw_ = true; | 141 did_request_redraw_ = true; |
| 142 } | 142 } |
| 143 void SetNeedsAnimateOnImplThread() override { did_request_animate_ = true; } | 143 void SetNeedsAnimateOnImplThread() override { did_request_animate_ = true; } |
| 144 void SetNeedsPrepareTilesOnImplThread() override { | 144 void SetNeedsPrepareTilesOnImplThread(bool for_commit) override { |
| 145 did_request_prepare_tiles_ = true; | 145 did_request_prepare_tiles_ = true; |
| 146 } | 146 } |
| 147 void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; } | 147 void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; } |
| 148 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override {} | 148 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override {} |
| 149 void PostAnimationEventsToMainThreadOnImplThread( | 149 void PostAnimationEventsToMainThreadOnImplThread( |
| 150 scoped_ptr<AnimationEventsVector> events) override {} | 150 scoped_ptr<AnimationEventsVector> events) override {} |
| 151 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, | 151 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, |
| 152 int priority_cutoff) override { | 152 int priority_cutoff) override { |
| 153 current_limit_bytes_ = limit_bytes; | 153 current_limit_bytes_ = limit_bytes; |
| 154 current_priority_cutoff_value_ = priority_cutoff; | 154 current_priority_cutoff_value_ = priority_cutoff; |
| 155 return reduce_memory_result_; | 155 return reduce_memory_result_; |
| 156 } | 156 } |
| 157 bool IsInsideDraw() override { return false; } | 157 bool IsInsideDraw() override { return false; } |
| 158 void RenewTreePriority() override {} | 158 void RenewTreePriority() override {} |
| 159 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, | 159 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, |
| 160 base::TimeDelta delay) override { | 160 base::TimeDelta delay) override { |
| 161 animation_task_ = task; | 161 animation_task_ = task; |
| 162 requested_animation_delay_ = delay; | 162 requested_animation_delay_ = delay; |
| 163 } | 163 } |
| 164 void DidActivateSyncTree() override {} | 164 void DidActivateSyncTree() override {} |
| 165 void DidPrepareTiles() override {} | |
| 166 void DidCompletePageScaleAnimationOnImplThread() override { | 165 void DidCompletePageScaleAnimationOnImplThread() override { |
| 167 did_complete_page_scale_animation_ = true; | 166 did_complete_page_scale_animation_ = true; |
| 168 } | 167 } |
| 169 void OnDrawForOutputSurface() override {} | 168 void OnDrawForOutputSurface() override {} |
| 170 | 169 |
| 171 void set_reduce_memory_result(bool reduce_memory_result) { | 170 void set_reduce_memory_result(bool reduce_memory_result) { |
| 172 reduce_memory_result_ = reduce_memory_result; | 171 reduce_memory_result_ = reduce_memory_result; |
| 173 } | 172 } |
| 174 | 173 |
| 175 virtual bool CreateHostImpl(const LayerTreeSettings& settings, | 174 virtual bool CreateHostImpl(const LayerTreeSettings& settings, |
| (...skipping 7696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7872 // Hold an unowned pointer to the output surface to use for mock expectations. | 7871 // Hold an unowned pointer to the output surface to use for mock expectations. |
| 7873 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); | 7872 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); |
| 7874 | 7873 |
| 7875 CreateHostImpl(DefaultSettings(), output_surface.Pass()); | 7874 CreateHostImpl(DefaultSettings(), output_surface.Pass()); |
| 7876 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); | 7875 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); |
| 7877 host_impl_->BeginCommit(); | 7876 host_impl_->BeginCommit(); |
| 7878 } | 7877 } |
| 7879 | 7878 |
| 7880 } // namespace | 7879 } // namespace |
| 7881 } // namespace cc | 7880 } // namespace cc |
| OLD | NEW |