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

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

Issue 178123003: Make it possible to cancel commits following an animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cc_perftests failure. Make unit test limits stricter. Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 47 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
48 settings->throttle_frame_production = false; 48 settings->throttle_frame_production = false;
49 } 49 }
50 50
51 virtual void BeginTest() OVERRIDE { 51 virtual void BeginTest() OVERRIDE {
52 BuildTree(); 52 BuildTree();
53 PostSetNeedsCommitToMainThread(); 53 PostSetNeedsCommitToMainThread();
54 } 54 }
55 55
56 virtual void Animate(base::TimeTicks monotonic_time) OVERRIDE { 56 virtual void Animate(base::TimeTicks monotonic_time) OVERRIDE {
57 if (animation_driven_drawing_ && !TestEnded()) 57 if (animation_driven_drawing_ && !TestEnded()) {
58 layer_tree_host()->SetNeedsAnimate(); 58 layer_tree_host()->SetNeedsAnimate();
59 layer_tree_host()->SetNextCommitForcesRedraw();
60 }
59 } 61 }
60 62
61 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { 63 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
62 if (measure_commit_cost_) 64 if (measure_commit_cost_)
63 commit_timer_.Start(); 65 commit_timer_.Start();
64 } 66 }
65 67
66 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { 68 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
67 if (measure_commit_cost_ && draw_timer_.IsWarmedUp()) { 69 if (measure_commit_cost_ && draw_timer_.IsWarmedUp()) {
68 commit_timer_.NextLap(); 70 commit_timer_.NextLap();
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) { 325 TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) {
324 animation_driven_drawing_ = true; 326 animation_driven_drawing_ = true;
325 measure_commit_cost_ = true; 327 measure_commit_cost_ = true;
326 SetTestName("heavy_page"); 328 SetTestName("heavy_page");
327 ReadTestFile("heavy_layer_tree"); 329 ReadTestFile("heavy_layer_tree");
328 RunTestWithImplSidePainting(); 330 RunTestWithImplSidePainting();
329 } 331 }
330 332
331 } // namespace 333 } // namespace
332 } // namespace cc 334 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698