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

Side by Side Diff: cc/scheduler_unittest.cc

Issue 11879012: cc: Redraw incomplete frames when new texture uploads finish (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_draw3b
Patch Set: rename some method, only check for incomplete frames when impl-side painting Created 7 years, 11 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
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.h" 5 #include "cc/scheduler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/test/scheduler_test_common.h" 8 #include "cc/test/scheduler_test_common.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return ScheduledActionDrawAndSwapResult(m_drawWillHappen, m_drawWillHapp en && m_swapWillHappenIfDrawHappens); 43 return ScheduledActionDrawAndSwapResult(m_drawWillHappen, m_drawWillHapp en && m_swapWillHappenIfDrawHappens);
44 } 44 }
45 45
46 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() OVERRIDE 46 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() OVERRIDE
47 { 47 {
48 m_actions.push_back("scheduledActionDrawAndSwapForced"); 48 m_actions.push_back("scheduledActionDrawAndSwapForced");
49 return ScheduledActionDrawAndSwapResult(true, m_swapWillHappenIfDrawHapp ens); 49 return ScheduledActionDrawAndSwapResult(true, m_swapWillHappenIfDrawHapp ens);
50 } 50 }
51 51
52 virtual void scheduledActionCommit() OVERRIDE { m_actions.push_back("schedul edActionCommit"); } 52 virtual void scheduledActionCommit() OVERRIDE { m_actions.push_back("schedul edActionCommit"); }
53 virtual void scheduledActionCheckForNewTextures() OVERRIDE { m_actions.push_ back("scheduledActionCheckForNewTextures"); }
53 virtual void scheduledActionActivatePendingTreeIfNeeded() OVERRIDE { m_actio ns.push_back("scheduledActionActivatePendingTreeIfNeeded"); } 54 virtual void scheduledActionActivatePendingTreeIfNeeded() OVERRIDE { m_actio ns.push_back("scheduledActionActivatePendingTreeIfNeeded"); }
54 virtual void scheduledActionBeginContextRecreation() OVERRIDE { m_actions.pu sh_back("scheduledActionBeginContextRecreation"); } 55 virtual void scheduledActionBeginContextRecreation() OVERRIDE { m_actions.pu sh_back("scheduledActionBeginContextRecreation"); }
55 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE { m _actions.push_back("scheduledActionAcquireLayerTexturesForMainThread"); } 56 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE { m _actions.push_back("scheduledActionAcquireLayerTexturesForMainThread"); }
56 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { } 57 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE { }
57 58
58 void setDrawWillHappen(bool drawWillHappen) { m_drawWillHappen = drawWillHap pen; } 59 void setDrawWillHappen(bool drawWillHappen) { m_drawWillHappen = drawWillHap pen; }
59 void setSwapWillHappenIfDrawHappens(bool swapWillHappenIfDrawHappens) { m_sw apWillHappenIfDrawHappens = swapWillHappenIfDrawHappens; } 60 void setSwapWillHappenIfDrawHappens(bool swapWillHappenIfDrawHappens) { m_sw apWillHappenIfDrawHappens = swapWillHappenIfDrawHappens; }
60 61
61 protected: 62 protected:
62 bool m_drawWillHappen; 63 bool m_drawWillHappen;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 scheduler->setNeedsRedraw(); 470 scheduler->setNeedsRedraw();
470 scheduler->setNeedsForcedRedraw(); 471 scheduler->setNeedsForcedRedraw();
471 EXPECT_TRUE(client.hasAction("scheduledActionDrawAndSwapForced")); 472 EXPECT_TRUE(client.hasAction("scheduledActionDrawAndSwapForced"));
472 473
473 // We should not have told the frame rate controller that we began a frame. 474 // We should not have told the frame rate controller that we began a frame.
474 EXPECT_EQ(0, controllerPtr->numFramesPending()); 475 EXPECT_EQ(0, controllerPtr->numFramesPending());
475 } 476 }
476 477
477 } // namespace 478 } // namespace
478 } // namespace cc 479 } // namespace cc
OLDNEW
« cc/scheduler.h ('K') | « cc/scheduler_state_machine.cc ('k') | cc/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698