summaryrefslogtreecommitdiffstats
path: root/cc/output
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2015-11-17 11:59:04 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 19:59:48 +0000
commitae103dce017d5f80abf91f0ec910be6984938efd (patch)
tree6e976f1f40d9f9e92a6e9269eefa76782e99ec8a /cc/output
parentfa34509da501eb4fb9a7f89842c65b0e17a8b9df (diff)
downloadchromium_src-ae103dce017d5f80abf91f0ec910be6984938efd.zip
chromium_src-ae103dce017d5f80abf91f0ec910be6984938efd.tar.gz
chromium_src-ae103dce017d5f80abf91f0ec910be6984938efd.tar.bz2
Revert "Revert of Converted simple Sync Point Signals to Sync token Signals.
(patchset #5 id:80001 of https://codereview.chromium.org/1448433002/ )" This reverts commit 6d9cfba1fba7479e4e1ad5c47e05f46661a051cf. Original issue's description: > Converted simple Sync Point Signals to Sync token Signals. > > This CL is part of the ongoing refactor of old sync points to the new > sync tokens. Only simple straight forward changes have been converted > here, there are other more complex ones still so the SignalSyncPoint() > function cannot be completely removed yet. > > BUG=514815 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/5f56df573df3e6c2bf6ced027be8c02884ca944f > Cr-Commit-Position: refs/heads/master@{#359925} R=piman@chromium.org BUG=514815 556855 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1453203002 Cr-Commit-Position: refs/heads/master@{#360139}
Diffstat (limited to 'cc/output')
-rw-r--r--cc/output/gl_renderer_unittest.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 92fcd3c..5834d24 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -1935,7 +1935,7 @@ TEST_F(MockOutputSurfaceTest, DrawFrameAndResizeAndSwap) {
class GLRendererTestSyncPoint : public GLRendererPixelTest {
protected:
- static void SyncPointCallback(int* callback_count) {
+ static void SyncTokenCallback(int* callback_count) {
++(*callback_count);
base::MessageLoop::current()->QuitWhenIdle();
}
@@ -1948,21 +1948,25 @@ class GLRendererTestSyncPoint : public GLRendererPixelTest {
#if !defined(OS_ANDROID)
TEST_F(GLRendererTestSyncPoint, SignalSyncPointOnLostContext) {
- int sync_point_callback_count = 0;
+ int sync_token_callback_count = 0;
int other_callback_count = 0;
gpu::gles2::GLES2Interface* gl =
output_surface_->context_provider()->ContextGL();
gpu::ContextSupport* context_support =
output_surface_->context_provider()->ContextSupport();
- uint32 sync_point = gl->InsertSyncPointCHROMIUM();
+ const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM();
+ gl->ShallowFlushCHROMIUM();
+
+ gpu::SyncToken sync_token;
+ gl->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
gl->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
GL_INNOCENT_CONTEXT_RESET_ARB);
- context_support->SignalSyncPoint(
- sync_point, base::Bind(&SyncPointCallback, &sync_point_callback_count));
- EXPECT_EQ(0, sync_point_callback_count);
+ context_support->SignalSyncToken(
+ sync_token, base::Bind(&SyncTokenCallback, &sync_token_callback_count));
+ EXPECT_EQ(0, sync_token_callback_count);
EXPECT_EQ(0, other_callback_count);
// Make the sync point happen.
@@ -1974,12 +1978,12 @@ TEST_F(GLRendererTestSyncPoint, SignalSyncPointOnLostContext) {
base::MessageLoop::current()->Run();
// The sync point shouldn't have happened since the context was lost.
- EXPECT_EQ(0, sync_point_callback_count);
+ EXPECT_EQ(0, sync_token_callback_count);
EXPECT_EQ(1, other_callback_count);
}
TEST_F(GLRendererTestSyncPoint, SignalSyncPoint) {
- int sync_point_callback_count = 0;
+ int sync_token_callback_count = 0;
int other_callback_count = 0;
gpu::gles2::GLES2Interface* gl =
@@ -1987,11 +1991,15 @@ TEST_F(GLRendererTestSyncPoint, SignalSyncPoint) {
gpu::ContextSupport* context_support =
output_surface_->context_provider()->ContextSupport();
- uint32 sync_point = gl->InsertSyncPointCHROMIUM();
+ const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM();
+ gl->ShallowFlushCHROMIUM();
+
+ gpu::SyncToken sync_token;
+ gl->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
- context_support->SignalSyncPoint(
- sync_point, base::Bind(&SyncPointCallback, &sync_point_callback_count));
- EXPECT_EQ(0, sync_point_callback_count);
+ context_support->SignalSyncToken(
+ sync_token, base::Bind(&SyncTokenCallback, &sync_token_callback_count));
+ EXPECT_EQ(0, sync_token_callback_count);
EXPECT_EQ(0, other_callback_count);
// Make the sync point happen.
@@ -2003,7 +2011,7 @@ TEST_F(GLRendererTestSyncPoint, SignalSyncPoint) {
base::MessageLoop::current()->Run();
// The sync point should have happened.
- EXPECT_EQ(1, sync_point_callback_count);
+ EXPECT_EQ(1, sync_token_callback_count);
EXPECT_EQ(1, other_callback_count);
}
#endif // OS_ANDROID