Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1131633003: cc: Use multiple PrepareTiles approaches Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void NotifyReadyToActivate() override { 135 void NotifyReadyToActivate() override {
136 did_notify_ready_to_activate_ = true; 136 did_notify_ready_to_activate_ = true;
137 host_impl_->ActivateSyncTree(); 137 host_impl_->ActivateSyncTree();
138 } 138 }
139 void NotifyReadyToDraw() override {} 139 void NotifyReadyToDraw() override {}
140 void SetNeedsRedrawOnImplThread() override { did_request_redraw_ = true; } 140 void SetNeedsRedrawOnImplThread() override { did_request_redraw_ = true; }
141 void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override { 141 void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override {
142 did_request_redraw_ = true; 142 did_request_redraw_ = true;
143 } 143 }
144 void SetNeedsAnimateOnImplThread() override { did_request_animate_ = true; } 144 void SetNeedsAnimateOnImplThread() override { did_request_animate_ = true; }
145 void SetNeedsPrepareTilesOnImplThread() override { 145 void SetNeedsPrepareTilesOnImplThread(bool for_commit) override {
146 did_request_prepare_tiles_ = true; 146 did_request_prepare_tiles_ = true;
147 } 147 }
148 void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; } 148 void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; }
149 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override {} 149 void SetVideoNeedsBeginFrames(bool needs_begin_frames) override {}
150 void PostAnimationEventsToMainThreadOnImplThread( 150 void PostAnimationEventsToMainThreadOnImplThread(
151 scoped_ptr<AnimationEventsVector> events) override {} 151 scoped_ptr<AnimationEventsVector> events) override {}
152 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, 152 bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
153 int priority_cutoff) override { 153 int priority_cutoff) override {
154 current_limit_bytes_ = limit_bytes; 154 current_limit_bytes_ = limit_bytes;
155 current_priority_cutoff_value_ = priority_cutoff; 155 current_priority_cutoff_value_ = priority_cutoff;
156 return reduce_memory_result_; 156 return reduce_memory_result_;
157 } 157 }
158 bool IsInsideDraw() override { return false; } 158 bool IsInsideDraw() override { return false; }
159 void RenewTreePriority() override {} 159 void RenewTreePriority() override {}
160 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, 160 void PostDelayedAnimationTaskOnImplThread(const base::Closure& task,
161 base::TimeDelta delay) override { 161 base::TimeDelta delay) override {
162 animation_task_ = task; 162 animation_task_ = task;
163 requested_animation_delay_ = delay; 163 requested_animation_delay_ = delay;
164 } 164 }
165 void DidActivateSyncTree() override {} 165 void DidActivateSyncTree() override {}
166 void DidPrepareTiles() override {}
167 void DidCompletePageScaleAnimationOnImplThread() override { 166 void DidCompletePageScaleAnimationOnImplThread() override {
168 did_complete_page_scale_animation_ = true; 167 did_complete_page_scale_animation_ = true;
169 } 168 }
170 void OnDrawForOutputSurface() override {} 169 void OnDrawForOutputSurface() override {}
171 170
172 void set_reduce_memory_result(bool reduce_memory_result) { 171 void set_reduce_memory_result(bool reduce_memory_result) {
173 reduce_memory_result_ = reduce_memory_result; 172 reduce_memory_result_ = reduce_memory_result;
174 } 173 }
175 174
176 virtual bool CreateHostImpl(const LayerTreeSettings& settings, 175 virtual bool CreateHostImpl(const LayerTreeSettings& settings,
(...skipping 7603 matching lines...) Expand 10 before | Expand all | Expand 10 after
7780 host_impl_->set_has_gpu_rasterization_trigger(false); 7779 host_impl_->set_has_gpu_rasterization_trigger(false);
7781 host_impl_->set_content_is_suitable_for_gpu_rasterization(false); 7780 host_impl_->set_content_is_suitable_for_gpu_rasterization(false);
7782 host_impl_->UpdateGpuRasterizationStatus(); 7781 host_impl_->UpdateGpuRasterizationStatus();
7783 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, 7782 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED,
7784 host_impl_->gpu_rasterization_status()); 7783 host_impl_->gpu_rasterization_status());
7785 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); 7784 EXPECT_TRUE(host_impl_->use_gpu_rasterization());
7786 } 7785 }
7787 7786
7788 } // namespace 7787 } // namespace
7789 } // namespace cc 7788 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698