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

Side by Side Diff: cc/scheduler/scheduler_state_machine_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, 2 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/scheduler/scheduler_state_machine.cc ('k') | cc/scheduler/scheduler_unittest.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 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_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/scheduler/scheduler.h" 8 #include "cc/scheduler/scheduler.h"
9 #include "cc/test/begin_frame_args_test.h" 9 #include "cc/test/begin_frame_args_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 1781
1782 state.SetCanDraw(false); 1782 state.SetCanDraw(false);
1783 state.SetVisible(false); 1783 state.SetVisible(false);
1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); 1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
1785 1785
1786 state.SetCanDraw(true); 1786 state.SetCanDraw(true);
1787 state.SetVisible(true); 1787 state.SetVisible(true);
1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); 1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1789 } 1789 }
1790 1790
1791 TEST(SchedulerStateMachineTest, ForceDrawForSynchronousCompositor) { 1791 TEST(SchedulerStateMachineTest, ForceDrawForResourcelessSoftwareDraw) {
1792 SchedulerSettings scheduler_settings; 1792 SchedulerSettings default_scheduler_settings;
1793 scheduler_settings.using_synchronous_renderer_compositor = true; 1793 StateMachine state(default_scheduler_settings);
1794 StateMachine state(scheduler_settings);
1795 SET_UP_STATE(state) 1794 SET_UP_STATE(state)
1795 state.SetResourcelessSoftareDraw(true);
1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1797 1797
1798 state.SetVisible(false); 1798 state.SetVisible(false);
1799 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1800
1801 state.SetResourcelessSoftareDraw(false);
1802 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
1803
1804 state.SetResourcelessSoftareDraw(true);
1805 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1806
1807 state.SetVisible(false);
1799 state.DidLoseOutputSurface(); 1808 state.DidLoseOutputSurface();
1800 1809
1801 state.SetCanDraw(false); 1810 state.SetCanDraw(false);
1802 state.WillBeginOutputSurfaceCreation(); 1811 state.WillBeginOutputSurfaceCreation();
1803 state.DidCreateAndInitializeOutputSurface(); 1812 state.DidCreateAndInitializeOutputSurface();
1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); 1813 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
1805 1814
1806 state.SetCanDraw(true); 1815 state.SetCanDraw(true);
1807 state.DidLoseOutputSurface(); 1816 state.DidLoseOutputSurface();
1808 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); 1817 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2104 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2096 bool commit_has_no_updates = true; 2105 bool commit_has_no_updates = true;
2097 state.WillCommit(commit_has_no_updates); 2106 state.WillCommit(commit_has_no_updates);
2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); 2107 EXPECT_TRUE(state.ProactiveBeginFrameWanted());
2099 state.OnBeginImplFrame(); 2108 state.OnBeginImplFrame();
2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2109 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2101 } 2110 }
2102 2111
2103 } // namespace 2112 } // namespace
2104 } // namespace cc 2113 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698