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

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 246753008: cc: Unify use of DidSwapBuffers() and did_request_swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 17 matching lines...) Expand all
28 #include "testing/gmock/include/gmock/gmock.h" 28 #include "testing/gmock/include/gmock/gmock.h"
29 #include "ui/gfx/frame_time.h" 29 #include "ui/gfx/frame_time.h"
30 #include "ui/gfx/size_conversions.h" 30 #include "ui/gfx/size_conversions.h"
31 31
32 namespace cc { 32 namespace cc {
33 33
34 TestHooks::TestHooks() {} 34 TestHooks::TestHooks() {}
35 35
36 TestHooks::~TestHooks() {} 36 TestHooks::~TestHooks() {}
37 37
38 DrawSwapReadbackResult::DrawResult TestHooks::PrepareToDrawOnThread( 38 DrawResult TestHooks::PrepareToDrawOnThread(
39 LayerTreeHostImpl* host_impl, 39 LayerTreeHostImpl* host_impl,
40 LayerTreeHostImpl::FrameData* frame_data, 40 LayerTreeHostImpl::FrameData* frame_data,
41 DrawSwapReadbackResult::DrawResult draw_result) { 41 DrawResult draw_result) {
42 return draw_result; 42 return draw_result;
43 } 43 }
44 44
45 base::TimeDelta TestHooks::LowFrequencyAnimationInterval() const { 45 base::TimeDelta TestHooks::LowFrequencyAnimationInterval() const {
46 return base::TimeDelta::FromMilliseconds(16); 46 return base::TimeDelta::FromMilliseconds(16);
47 } 47 }
48 48
49 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. 49 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks.
50 class LayerTreeHostImplForTesting : public LayerTreeHostImpl { 50 class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
51 public: 51 public:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual void CommitComplete() OVERRIDE { 101 virtual void CommitComplete() OVERRIDE {
102 LayerTreeHostImpl::CommitComplete(); 102 LayerTreeHostImpl::CommitComplete();
103 test_hooks_->CommitCompleteOnThread(this); 103 test_hooks_->CommitCompleteOnThread(this);
104 104
105 if (!settings().impl_side_painting) { 105 if (!settings().impl_side_painting) {
106 test_hooks_->WillActivateTreeOnThread(this); 106 test_hooks_->WillActivateTreeOnThread(this);
107 test_hooks_->DidActivateTreeOnThread(this); 107 test_hooks_->DidActivateTreeOnThread(this);
108 } 108 }
109 } 109 }
110 110
111 virtual DrawSwapReadbackResult::DrawResult PrepareToDraw( 111 virtual DrawResult PrepareToDraw(FrameData* frame,
112 FrameData* frame, 112 const gfx::Rect& damage_rect) OVERRIDE {
113 const gfx::Rect& damage_rect) OVERRIDE { 113 DrawResult draw_result =
114 DrawSwapReadbackResult::DrawResult draw_result =
115 LayerTreeHostImpl::PrepareToDraw(frame, damage_rect); 114 LayerTreeHostImpl::PrepareToDraw(frame, damage_rect);
116 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); 115 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result);
117 } 116 }
118 117
119 virtual void DrawLayers(FrameData* frame, 118 virtual void DrawLayers(FrameData* frame,
120 base::TimeTicks frame_begin_time) OVERRIDE { 119 base::TimeTicks frame_begin_time) OVERRIDE {
121 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); 120 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time);
122 test_hooks_->DrawLayersOnThread(this); 121 test_hooks_->DrawLayersOnThread(this);
123 } 122 }
124 123
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 return -1; 696 return -1;
698 } 697 }
699 698
700 void LayerTreeTest::DestroyLayerTreeHost() { 699 void LayerTreeTest::DestroyLayerTreeHost() {
701 if (layer_tree_host_ && layer_tree_host_->root_layer()) 700 if (layer_tree_host_ && layer_tree_host_->root_layer())
702 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 701 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
703 layer_tree_host_.reset(); 702 layer_tree_host_.reset();
704 } 703 }
705 704
706 } // namespace cc 705 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698