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

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

Issue 723713003: cc: Add SetChildrenNeedBeginFrames() & SendBeginFramesToChildren() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 1 month 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
« no previous file with comments | « cc/trees/layer_tree_host_client.h ('k') | cc/trees/proxy.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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 5203 matching lines...) Expand 10 before | Expand all | Expand 10 after
5214 int num_draws_; 5214 int num_draws_;
5215 const gfx::Size bounds_; 5215 const gfx::Size bounds_;
5216 FakeContentLayerClient client_; 5216 FakeContentLayerClient client_;
5217 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; 5217 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_;
5218 scoped_refptr<FakePictureLayer> picture_layer_; 5218 scoped_refptr<FakePictureLayer> picture_layer_;
5219 Layer* child_layer_; 5219 Layer* child_layer_;
5220 }; 5220 };
5221 5221
5222 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); 5222 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
5223 5223
5224 class LayerTreeHostTestSendBeginFramesToChildren : public LayerTreeHostTest {
5225 public:
5226 LayerTreeHostTestSendBeginFramesToChildren()
5227 : begin_frame_sent_to_children_(false) {
5228 }
5229
5230 void InitializeSettings(LayerTreeSettings* settings) override {
5231 settings->forward_begin_frames_to_children = true;
5232 }
5233
5234 void BeginTest() override {
5235 // Kick off the test with a commit.
5236 PostSetNeedsCommitToMainThread();
5237 }
5238
5239 void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
5240 begin_frame_sent_to_children_ = true;
5241 EndTest();
5242 }
5243
5244 void DidBeginMainFrame() override {
5245 // Children requested BeginFrames.
5246 layer_tree_host()->SetChildrenNeedBeginFrames(true);
5247 }
5248
5249 void AfterTest() override {
5250 // Ensure that BeginFrame message is sent to children during parent
5251 // scheduler handles its BeginFrame.
5252 EXPECT_TRUE(begin_frame_sent_to_children_);
5253 }
5254
5255 private:
5256 bool begin_frame_sent_to_children_;
5257 };
5258
5259 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildren);
5260
5261 class LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS
5262 : public LayerTreeHostTest {
5263 public:
5264 LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS()
5265 : begin_frame_sent_to_children_(false) {
5266 }
5267
5268 void InitializeSettings(LayerTreeSettings* settings) override {
5269 settings->use_external_begin_frame_source = true;
5270 settings->forward_begin_frames_to_children = true;
5271 }
5272
5273 void BeginTest() override {
5274 // Kick off the test with a commit.
5275 PostSetNeedsCommitToMainThread();
5276 }
5277
5278 void SendBeginFramesToChildren(const BeginFrameArgs& args) override {
5279 begin_frame_sent_to_children_ = true;
5280 EndTest();
5281 }
5282
5283 void DidBeginMainFrame() override {
5284 // Children requested BeginFrames.
5285 layer_tree_host()->SetChildrenNeedBeginFrames(true);
5286 }
5287
5288 void AfterTest() override {
5289 // Ensure that BeginFrame message is sent to children during parent
5290 // scheduler handles its BeginFrame.
5291 EXPECT_TRUE(begin_frame_sent_to_children_);
5292 }
5293
5294 private:
5295 bool begin_frame_sent_to_children_;
5296 };
5297
5298 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS);
5299
5224 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { 5300 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
5225 public: 5301 public:
5226 LayerTreeHostTestActivateOnInvisible() 5302 LayerTreeHostTestActivateOnInvisible()
5227 : activation_count_(0), visible_(true) {} 5303 : activation_count_(0), visible_(true) {}
5228 5304
5229 void InitializeSettings(LayerTreeSettings* settings) override { 5305 void InitializeSettings(LayerTreeSettings* settings) override {
5230 settings->impl_side_painting = true; 5306 settings->impl_side_painting = true;
5231 } 5307 }
5232 5308
5233 void BeginTest() override { 5309 void BeginTest() override {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
5782 5858
5783 FakeContentLayerClient client_; 5859 FakeContentLayerClient client_;
5784 int step_; 5860 int step_;
5785 int continuous_draws_; 5861 int continuous_draws_;
5786 base::WaitableEvent playback_allowed_event_; 5862 base::WaitableEvent playback_allowed_event_;
5787 }; 5863 };
5788 5864
5789 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles); 5865 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles);
5790 5866
5791 } // namespace cc 5867 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_client.h ('k') | cc/trees/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698