| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
| 7 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include <memory> |
| 10 |
| 10 #include "gpu/command_buffer/common/sync_token.h" | 11 #include "gpu/command_buffer/common/sync_token.h" |
| 11 #include "gpu/command_buffer/service/sync_point_manager.h" | 12 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 12 #include "gpu/command_buffer/tests/gl_manager.h" | 13 #include "gpu/command_buffer/tests/gl_manager.h" |
| 13 #include "gpu/command_buffer/tests/gl_test_utils.h" | 14 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 #define SHADER(Src) #Src | 18 #define SHADER(Src) #Src |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| 21 class GLFenceSyncTest : public testing::Test { | 22 class GLFenceSyncTest : public testing::Test { |
| 22 protected: | 23 protected: |
| 23 void SetUp() override { | 24 void SetUp() override { |
| 24 sync_point_manager_.reset(new SyncPointManager(false)); | 25 sync_point_manager_.reset(new SyncPointManager(false)); |
| 25 | 26 |
| 26 GLManager::Options options; | 27 GLManager::Options options; |
| 27 options.sync_point_manager = sync_point_manager_.get(); | 28 options.sync_point_manager = sync_point_manager_.get(); |
| 28 gl1_.Initialize(options); | 29 gl1_.Initialize(options); |
| 29 gl2_.Initialize(options); | 30 gl2_.Initialize(options); |
| 30 } | 31 } |
| 31 | 32 |
| 32 void TearDown() override { | 33 void TearDown() override { |
| 33 gl2_.Destroy(); | 34 gl2_.Destroy(); |
| 34 gl1_.Destroy(); | 35 gl1_.Destroy(); |
| 35 | 36 |
| 36 sync_point_manager_.reset(); | 37 sync_point_manager_.reset(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 scoped_ptr<SyncPointManager> sync_point_manager_; | 40 std::unique_ptr<SyncPointManager> sync_point_manager_; |
| 40 GLManager gl1_; | 41 GLManager gl1_; |
| 41 GLManager gl2_; | 42 GLManager gl2_; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 TEST_F(GLFenceSyncTest, SimpleReleaseWait) { | 45 TEST_F(GLFenceSyncTest, SimpleReleaseWait) { |
| 45 gl1_.MakeCurrent(); | 46 gl1_.MakeCurrent(); |
| 46 | 47 |
| 47 const GLuint64 fence_sync = glInsertFenceSyncCHROMIUM(); | 48 const GLuint64 fence_sync = glInsertFenceSyncCHROMIUM(); |
| 48 SyncToken sync_token; | 49 SyncToken sync_token; |
| 49 glFlush(); | 50 glFlush(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 gl1_.MakeCurrent(); | 92 gl1_.MakeCurrent(); |
| 92 EXPECT_EQ(0, callback_called); | 93 EXPECT_EQ(0, callback_called); |
| 93 | 94 |
| 94 gl1_.SetCommandsPaused(false); | 95 gl1_.SetCommandsPaused(false); |
| 95 glFinish(); | 96 glFinish(); |
| 96 | 97 |
| 97 EXPECT_EQ(1, callback_called); | 98 EXPECT_EQ(1, callback_called); |
| 98 } | 99 } |
| 99 | 100 |
| 100 } // namespace gpu | 101 } // namespace gpu |
| OLD | NEW |