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

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

Issue 1186393004: gpu: Remove async texture uploads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 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_settings.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 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/delegated_frame_provider.h" 8 #include "cc/layers/delegated_frame_provider.h"
9 #include "cc/layers/delegated_frame_resource_collection.h" 9 #include "cc/layers/delegated_frame_resource_collection.h"
10 #include "cc/layers/heads_up_display_layer.h" 10 #include "cc/layers/heads_up_display_layer.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 class MultipleCompositeDoesNotCreateOutputSurface 385 class MultipleCompositeDoesNotCreateOutputSurface
386 : public LayerTreeHostContextTest { 386 : public LayerTreeHostContextTest {
387 public: 387 public:
388 MultipleCompositeDoesNotCreateOutputSurface() 388 MultipleCompositeDoesNotCreateOutputSurface()
389 : LayerTreeHostContextTest(), request_count_(0) {} 389 : LayerTreeHostContextTest(), request_count_(0) {}
390 390
391 void InitializeSettings(LayerTreeSettings* settings) override { 391 void InitializeSettings(LayerTreeSettings* settings) override {
392 settings->single_thread_proxy_scheduler = false; 392 settings->single_thread_proxy_scheduler = false;
393 settings->use_zero_copy = true; 393 settings->use_zero_copy = true;
394 settings->use_one_copy = false;
395 } 394 }
396 395
397 void RequestNewOutputSurface() override { 396 void RequestNewOutputSurface() override {
398 EXPECT_GE(1, ++request_count_); 397 EXPECT_GE(1, ++request_count_);
399 EndTest(); 398 EndTest();
400 } 399 }
401 400
402 void BeginTest() override { 401 void BeginTest() override {
403 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1)); 402 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(1));
404 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2)); 403 layer_tree_host()->Composite(base::TimeTicks::FromInternalValue(2));
(...skipping 19 matching lines...) Expand all
424 // trigger additional requests for output surfaces. 423 // trigger additional requests for output surfaces.
425 class FailedCreateDoesNotCreateExtraOutputSurface 424 class FailedCreateDoesNotCreateExtraOutputSurface
426 : public LayerTreeHostContextTest { 425 : public LayerTreeHostContextTest {
427 public: 426 public:
428 FailedCreateDoesNotCreateExtraOutputSurface() 427 FailedCreateDoesNotCreateExtraOutputSurface()
429 : LayerTreeHostContextTest(), num_requests_(0), has_failed_(false) {} 428 : LayerTreeHostContextTest(), num_requests_(0), has_failed_(false) {}
430 429
431 void InitializeSettings(LayerTreeSettings* settings) override { 430 void InitializeSettings(LayerTreeSettings* settings) override {
432 settings->single_thread_proxy_scheduler = false; 431 settings->single_thread_proxy_scheduler = false;
433 settings->use_zero_copy = true; 432 settings->use_zero_copy = true;
434 settings->use_one_copy = false;
435 } 433 }
436 434
437 void RequestNewOutputSurface() override { 435 void RequestNewOutputSurface() override {
438 num_requests_++; 436 num_requests_++;
439 // There should be one initial request and then one request from 437 // There should be one initial request and then one request from
440 // the LayerTreeTest test hooks DidFailToInitializeOutputSurface (which is 438 // the LayerTreeTest test hooks DidFailToInitializeOutputSurface (which is
441 // hard to skip). This second request is just ignored and is test cruft. 439 // hard to skip). This second request is just ignored and is test cruft.
442 EXPECT_LE(num_requests_, 2); 440 EXPECT_LE(num_requests_, 2);
443 if (num_requests_ > 1) 441 if (num_requests_ > 1)
444 return; 442 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 476
479 class LayerTreeHostContextTestCommitAfterDelayedOutputSurface 477 class LayerTreeHostContextTestCommitAfterDelayedOutputSurface
480 : public LayerTreeHostContextTest { 478 : public LayerTreeHostContextTest {
481 public: 479 public:
482 LayerTreeHostContextTestCommitAfterDelayedOutputSurface() 480 LayerTreeHostContextTestCommitAfterDelayedOutputSurface()
483 : LayerTreeHostContextTest(), creating_output_(false) {} 481 : LayerTreeHostContextTest(), creating_output_(false) {}
484 482
485 void InitializeSettings(LayerTreeSettings* settings) override { 483 void InitializeSettings(LayerTreeSettings* settings) override {
486 settings->single_thread_proxy_scheduler = false; 484 settings->single_thread_proxy_scheduler = false;
487 settings->use_zero_copy = true; 485 settings->use_zero_copy = true;
488 settings->use_one_copy = false;
489 } 486 }
490 487
491 void RequestNewOutputSurface() override { 488 void RequestNewOutputSurface() override {
492 MainThreadTaskRunner()->PostTask( 489 MainThreadTaskRunner()->PostTask(
493 FROM_HERE, 490 FROM_HERE,
494 base::Bind(&LayerTreeHostContextTestCommitAfterDelayedOutputSurface:: 491 base::Bind(&LayerTreeHostContextTestCommitAfterDelayedOutputSurface::
495 CreateAndSetOutputSurface, 492 CreateAndSetOutputSurface,
496 base::Unretained(this))); 493 base::Unretained(this)));
497 } 494 }
498 495
(...skipping 22 matching lines...) Expand all
521 518
522 class LayerTreeHostContextTestAvoidUnnecessaryComposite 519 class LayerTreeHostContextTestAvoidUnnecessaryComposite
523 : public LayerTreeHostContextTest { 520 : public LayerTreeHostContextTest {
524 public: 521 public:
525 LayerTreeHostContextTestAvoidUnnecessaryComposite() 522 LayerTreeHostContextTestAvoidUnnecessaryComposite()
526 : LayerTreeHostContextTest(), in_composite_(false) {} 523 : LayerTreeHostContextTest(), in_composite_(false) {}
527 524
528 void InitializeSettings(LayerTreeSettings* settings) override { 525 void InitializeSettings(LayerTreeSettings* settings) override {
529 settings->single_thread_proxy_scheduler = false; 526 settings->single_thread_proxy_scheduler = false;
530 settings->use_zero_copy = true; 527 settings->use_zero_copy = true;
531 settings->use_one_copy = false;
532 } 528 }
533 529
534 void RequestNewOutputSurface() override { 530 void RequestNewOutputSurface() override {
535 layer_tree_host()->SetOutputSurface( 531 layer_tree_host()->SetOutputSurface(
536 LayerTreeHostContextTest::CreateOutputSurface()); 532 LayerTreeHostContextTest::CreateOutputSurface());
537 EndTest(); 533 EndTest();
538 } 534 }
539 535
540 void BeginTest() override { 536 void BeginTest() override {
541 in_composite_ = true; 537 in_composite_ = true;
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 void AfterTest() override {} 1558 void AfterTest() override {}
1563 1559
1564 bool deferred_; 1560 bool deferred_;
1565 }; 1561 };
1566 1562
1567 SINGLE_AND_MULTI_THREAD_TEST_F( 1563 SINGLE_AND_MULTI_THREAD_TEST_F(
1568 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); 1564 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame);
1569 1565
1570 } // namespace 1566 } // namespace
1571 } // namespace cc 1567 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698