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

Side by Side Diff: cc/scheduler/scheduler_unittest.cc

Issue 1394263004: android webview: allow cc to fail hardware draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: damage before hardware to avoid invalidate-draw loop Created 5 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
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/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after
3429 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending()); 3429 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
3430 EXPECT_FALSE(scheduler_->PrepareTilesPending()); 3430 EXPECT_FALSE(scheduler_->PrepareTilesPending());
3431 client_->Reset(); 3431 client_->Reset();
3432 3432
3433 // Simulate SetNeedsBeginMainFrame due to input event. 3433 // Simulate SetNeedsBeginMainFrame due to input event.
3434 scheduler_->SetNeedsBeginMainFrame(); 3434 scheduler_->SetNeedsBeginMainFrame();
3435 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client_); 3435 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client_);
3436 client_->Reset(); 3436 client_->Reset();
3437 } 3437 }
3438 3438
3439 TEST_F(SchedulerTest, SynchronousCompositorOnDrawWhenInvisible) { 3439 TEST_F(SchedulerTest, SynchronousCompositorResourcelessOnDrawWhenInvisible) {
3440 scheduler_settings_.using_synchronous_renderer_compositor = true; 3440 scheduler_settings_.using_synchronous_renderer_compositor = true;
3441 scheduler_settings_.use_external_begin_frame_source = true; 3441 scheduler_settings_.use_external_begin_frame_source = true;
3442 SetUpScheduler(true); 3442 SetUpScheduler(true);
3443 3443
3444 scheduler_->SetVisible(false); 3444 scheduler_->SetVisible(false);
3445 scheduler_->SetResourcelessSoftareDraw(true);
3445 3446
3446 scheduler_->SetNeedsRedraw(); 3447 scheduler_->SetNeedsRedraw();
3447 scheduler_->OnDrawForOutputSurface(); 3448 scheduler_->OnDrawForOutputSurface();
3448 // Action animate is the result of SetNeedsRedraw. 3449 // Action animate is the result of SetNeedsRedraw.
3449 EXPECT_ACTION("ScheduledActionAnimate", client_, 0, 2); 3450 EXPECT_ACTION("ScheduledActionAnimate", client_, 0, 2);
3450 // SynchronousCompositor has to draw regardless of visibility. 3451 // SynchronousCompositor has to draw regardless of visibility.
3451 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 1, 2); 3452 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 1, 2);
3452 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending()); 3453 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
3453 client_->Reset(); 3454 client_->Reset();
3454 } 3455 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
3507 scheduler_->SetImplLatencyTakesPriority(true); 3508 scheduler_->SetImplLatencyTakesPriority(true);
3508 scheduler_->SetChildrenNeedBeginFrames(true); 3509 scheduler_->SetChildrenNeedBeginFrames(true);
3509 3510
3510 EXPECT_SCOPED(AdvanceFrame()); 3511 EXPECT_SCOPED(AdvanceFrame());
3511 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); 3512 EXPECT_TRUE(client_->begin_frame_is_sent_to_children());
3512 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); 3513 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path);
3513 } 3514 }
3514 3515
3515 } // namespace 3516 } // namespace
3516 } // namespace cc 3517 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698