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

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

Issue 1177033008: cc: Turn impl_side_painting and use_one_copy on in LayerTreeSettings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implon: fixwebkittests Created 5 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('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 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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/content_layer.h" 8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/delegated_frame_provider.h" 9 #include "cc/layers/delegated_frame_provider.h"
10 #include "cc/layers/delegated_frame_resource_collection.h" 10 #include "cc/layers/delegated_frame_resource_collection.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 class MultipleCompositeDoesNotCreateOutputSurface 379 class MultipleCompositeDoesNotCreateOutputSurface
380 : public LayerTreeHostContextTest { 380 : public LayerTreeHostContextTest {
381 public: 381 public:
382 MultipleCompositeDoesNotCreateOutputSurface() 382 MultipleCompositeDoesNotCreateOutputSurface()
383 : LayerTreeHostContextTest(), request_count_(0) {} 383 : LayerTreeHostContextTest(), request_count_(0) {}
384 384
385 void InitializeSettings(LayerTreeSettings* settings) override { 385 void InitializeSettings(LayerTreeSettings* settings) override {
386 settings->single_thread_proxy_scheduler = false; 386 settings->single_thread_proxy_scheduler = false;
387 settings->use_zero_copy = true; 387 settings->use_zero_copy = true;
388 settings->use_one_copy = false;
388 } 389 }
389 390
390 void RequestNewOutputSurface() override { 391 void RequestNewOutputSurface() override {
391 EXPECT_GE(1, ++request_count_); 392 EXPECT_GE(1, ++request_count_);
392 EndTest(); 393 EndTest();
393 } 394 }
394 395
395 void BeginTest() override { 396 void BeginTest() override {
396 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); 397 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1));
397 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2)); 398 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2));
(...skipping 19 matching lines...) Expand all
417 // trigger additional requests for output surfaces. 418 // trigger additional requests for output surfaces.
418 class FailedCreateDoesNotCreateExtraOutputSurface 419 class FailedCreateDoesNotCreateExtraOutputSurface
419 : public LayerTreeHostContextTest { 420 : public LayerTreeHostContextTest {
420 public: 421 public:
421 FailedCreateDoesNotCreateExtraOutputSurface() 422 FailedCreateDoesNotCreateExtraOutputSurface()
422 : LayerTreeHostContextTest(), num_requests_(0), has_failed_(false) {} 423 : LayerTreeHostContextTest(), num_requests_(0), has_failed_(false) {}
423 424
424 void InitializeSettings(LayerTreeSettings* settings) override { 425 void InitializeSettings(LayerTreeSettings* settings) override {
425 settings->single_thread_proxy_scheduler = false; 426 settings->single_thread_proxy_scheduler = false;
426 settings->use_zero_copy = true; 427 settings->use_zero_copy = true;
428 settings->use_one_copy = false;
427 } 429 }
428 430
429 void RequestNewOutputSurface() override { 431 void RequestNewOutputSurface() override {
430 num_requests_++; 432 num_requests_++;
431 // There should be one initial request and then one request from 433 // There should be one initial request and then one request from
432 // the LayerTreeTest test hooks DidFailToInitializeOutputSurface (which is 434 // the LayerTreeTest test hooks DidFailToInitializeOutputSurface (which is
433 // hard to skip). This second request is just ignored and is test cruft. 435 // hard to skip). This second request is just ignored and is test cruft.
434 EXPECT_LE(num_requests_, 2); 436 EXPECT_LE(num_requests_, 2);
435 if (num_requests_ > 1) 437 if (num_requests_ > 1)
436 return; 438 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 472
471 class LayerTreeHostContextTestCommitAfterDelayedOutputSurface 473 class LayerTreeHostContextTestCommitAfterDelayedOutputSurface
472 : public LayerTreeHostContextTest { 474 : public LayerTreeHostContextTest {
473 public: 475 public:
474 LayerTreeHostContextTestCommitAfterDelayedOutputSurface() 476 LayerTreeHostContextTestCommitAfterDelayedOutputSurface()
475 : LayerTreeHostContextTest(), creating_output_(false) {} 477 : LayerTreeHostContextTest(), creating_output_(false) {}
476 478
477 void InitializeSettings(LayerTreeSettings* settings) override { 479 void InitializeSettings(LayerTreeSettings* settings) override {
478 settings->single_thread_proxy_scheduler = false; 480 settings->single_thread_proxy_scheduler = false;
479 settings->use_zero_copy = true; 481 settings->use_zero_copy = true;
482 settings->use_one_copy = false;
480 } 483 }
481 484
482 void RequestNewOutputSurface() override { 485 void RequestNewOutputSurface() override {
483 MainThreadTaskRunner()->PostTask( 486 MainThreadTaskRunner()->PostTask(
484 FROM_HERE, 487 FROM_HERE,
485 base::Bind(&LayerTreeHostContextTestCommitAfterDelayedOutputSurface:: 488 base::Bind(&LayerTreeHostContextTestCommitAfterDelayedOutputSurface::
486 CreateAndSetOutputSurface, 489 CreateAndSetOutputSurface,
487 base::Unretained(this))); 490 base::Unretained(this)));
488 } 491 }
489 492
(...skipping 22 matching lines...) Expand all
512 515
513 class LayerTreeHostContextTestAvoidUnnecessaryComposite 516 class LayerTreeHostContextTestAvoidUnnecessaryComposite
514 : public LayerTreeHostContextTest { 517 : public LayerTreeHostContextTest {
515 public: 518 public:
516 LayerTreeHostContextTestAvoidUnnecessaryComposite() 519 LayerTreeHostContextTestAvoidUnnecessaryComposite()
517 : LayerTreeHostContextTest(), in_composite_(false) {} 520 : LayerTreeHostContextTest(), in_composite_(false) {}
518 521
519 void InitializeSettings(LayerTreeSettings* settings) override { 522 void InitializeSettings(LayerTreeSettings* settings) override {
520 settings->single_thread_proxy_scheduler = false; 523 settings->single_thread_proxy_scheduler = false;
521 settings->use_zero_copy = true; 524 settings->use_zero_copy = true;
525 settings->use_one_copy = false;
522 } 526 }
523 527
524 void RequestNewOutputSurface() override { 528 void RequestNewOutputSurface() override {
525 layer_tree_host()->SetOutputSurface( 529 layer_tree_host()->SetOutputSurface(
526 LayerTreeHostContextTest::CreateOutputSurface()); 530 LayerTreeHostContextTest::CreateOutputSurface());
527 EndTest(); 531 EndTest();
528 } 532 }
529 533
530 void BeginTest() override { 534 void BeginTest() override {
531 in_composite_ = true; 535 in_composite_ = true;
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 void AfterTest() override {} 1627 void AfterTest() override {}
1624 1628
1625 bool deferred_; 1629 bool deferred_;
1626 }; 1630 };
1627 1631
1628 SINGLE_AND_MULTI_THREAD_TEST_F( 1632 SINGLE_AND_MULTI_THREAD_TEST_F(
1629 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1633 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1630 1634
1631 } // namespace 1635 } // namespace
1632 } // namespace cc 1636 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698