diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-14 05:04:45 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-14 05:04:45 +0000 |
commit | b04b301af83033df836efd65c4f0f6be72dce0c3 (patch) | |
tree | 907eb8c5ae9957f36aed5f912f0ea3ac540c5ef8 /cc/output/output_surface_unittest.cc | |
parent | 01aba0df5ec1dcdb17455675e5e7cad1c9561ab5 (diff) | |
download | chromium_src-b04b301af83033df836efd65c4f0f6be72dce0c3.zip chromium_src-b04b301af83033df836efd65c4f0f6be72dce0c3.tar.gz chromium_src-b04b301af83033df836efd65c4f0f6be72dce0c3.tar.bz2 |
cc: Always use SetNeedsBeginFrame to request the next BeginFrame
This avoids relying on SwapBuffers to implicitly trigger the next
BeginFrame. Only a single code path is used to request the next
BeginFrame now: SetNeedsBeginFrame(true).
This avoids issues where OutputSurface subclasses might not call
OutputSurface::DidSwap() when they need to or when we early out
a swap request and don't actually swap anything.
BUG=289755
Review URL: https://chromiumcodereview.appspot.com/23498035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/output_surface_unittest.cc')
-rw-r--r-- | cc/output/output_surface_unittest.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc index 54fd3a1..cad5e4e 100644 --- a/cc/output/output_surface_unittest.cc +++ b/cc/output/output_surface_unittest.cc @@ -210,8 +210,10 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) { EXPECT_EQ(client.begin_frame_count(), 1); EXPECT_EQ(output_surface.pending_swap_buffers(), 0); - // DidSwapBuffers should clear the pending BeginFrame. + // SetNeedsBeginFrame should clear the pending BeginFrame after + // a SwapBuffers. output_surface.DidSwapBuffersForTesting(); + output_surface.SetNeedsBeginFrame(true); EXPECT_EQ(client.begin_frame_count(), 1); EXPECT_EQ(output_surface.pending_swap_buffers(), 1); task_runner->RunPendingTasks(); @@ -220,6 +222,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) { // BeginFrame should be throttled by pending swap buffers. output_surface.DidSwapBuffersForTesting(); + output_surface.SetNeedsBeginFrame(true); EXPECT_EQ(client.begin_frame_count(), 2); EXPECT_EQ(output_surface.pending_swap_buffers(), 2); task_runner->RunPendingTasks(); @@ -284,12 +287,14 @@ TEST(OutputSurfaceTest, OptimisticAndRetroactiveBeginFrames) { output_surface.BeginFrameForTesting(); EXPECT_EQ(client.begin_frame_count(), 2); output_surface.DidSwapBuffersForTesting(); + output_surface.SetNeedsBeginFrame(true); EXPECT_EQ(client.begin_frame_count(), 3); EXPECT_EQ(output_surface.pending_swap_buffers(), 1); // Optimistically injected BeginFrames should be by throttled by pending // swap buffers... output_surface.DidSwapBuffersForTesting(); + output_surface.SetNeedsBeginFrame(true); EXPECT_EQ(client.begin_frame_count(), 3); EXPECT_EQ(output_surface.pending_swap_buffers(), 2); output_surface.BeginFrameForTesting(); |