diff options
author | tiago.vignatti <tiago.vignatti@intel.com> | 2015-04-13 15:41:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-13 22:42:15 +0000 |
commit | 825c082c407341474d2083c180d90c3480b4ebbd (patch) | |
tree | 5801c40b9a852089dc57cadce40fb43e28f0d6f2 /gpu | |
parent | bd61b195388b86db195a43894cdf8bc36628d006 (diff) | |
download | chromium_src-825c082c407341474d2083c180d90c3480b4ebbd.zip chromium_src-825c082c407341474d2083c180d90c3480b4ebbd.tar.gz chromium_src-825c082c407341474d2083c180d90c3480b4ebbd.tar.bz2 |
gl_tests: Use zero size gl surface for offscreen rendering
In GLX, most of the drivers can cope with both PBuffer and Surfaceless modes
for offscreen rendering. In EGL though, Intel driver only works with
Surfaceless.
This CL changes all hardware platforms to use Surfaceless by forcing a zero
size GL surface initialization. Ozone-GBM wasn't previously working because of
that but now works like a charm ("[ PASSED ] 94 tests").
This CL also fixes gpu_unittests under Ozone-GBM ("[ PASSED ] 2544 tests")
and cleans a bit the message loop creation, bringing it to run earlier in the
RunTestSuite.
BUG=471261
TEST=gl_tests, gpu_unittests on both GBM and X11 (Linux)
NOTRY=true
Review URL: https://codereview.chromium.org/1025523005
Cr-Commit-Position: refs/heads/master@{#324925}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/DEPS | 1 | ||||
-rw-r--r-- | gpu/command_buffer/client/cmd_buffer_helper_test.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/client/fenced_allocator_test.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/client/mapped_memory_unittest.cc | 8 | ||||
-rw-r--r-- | gpu/command_buffer/client/ring_buffer_test.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/common/unittest_main.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler_unittest.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/tests/gl_manager.cc | 2 | ||||
-rw-r--r-- | gpu/command_buffer/tests/gl_tests_main.cc | 10 |
9 files changed, 18 insertions, 48 deletions
@@ -8,4 +8,5 @@ include_rules = [ "+ui/gfx", "+ui/gl", "+ui/surface", + "+ui/ozone/public", ] diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index ac83da5..6348abb 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc @@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/memory/linked_ptr.h" -#include "base/message_loop/message_loop.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/command_buffer_service.h" #include "gpu/command_buffer/service/gpu_scheduler.h" @@ -17,10 +16,6 @@ #include "gpu/command_buffer/service/transfer_buffer_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - namespace gpu { using testing::Return; @@ -256,10 +251,6 @@ class CommandBufferHelperTest : public testing::Test { CommandBufferOffset get_helper_put() { return helper_->put_; } -#if defined(OS_MACOSX) - base::mac::ScopedNSAutoreleasePool autorelease_pool_; -#endif - base::MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; scoped_ptr<CommandBufferServiceLocked> command_buffer_; diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index 3af9367..6b9f00f 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/memory/aligned_memory.h" -#include "base/message_loop/message_loop.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/client/fenced_allocator.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" @@ -17,10 +16,6 @@ #include "gpu/command_buffer/service/transfer_buffer_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - namespace gpu { using testing::Return; @@ -74,10 +69,6 @@ class BaseFencedAllocatorTest : public testing::Test { return command_buffer_->GetLastState().token; } -#if defined(OS_MACOSX) - base::mac::ScopedNSAutoreleasePool autorelease_pool_; -#endif - base::MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc index 9d5bada..6430b66 100644 --- a/gpu/command_buffer/client/mapped_memory_unittest.cc +++ b/gpu/command_buffer/client/mapped_memory_unittest.cc @@ -15,10 +15,6 @@ #include "gpu/command_buffer/service/transfer_buffer_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - namespace gpu { using testing::Return; @@ -71,10 +67,6 @@ class MappedMemoryTestBase : public testing::Test { return command_buffer_->GetLastState().token; } -#if defined(OS_MACOSX) - base::mac::ScopedNSAutoreleasePool autorelease_pool_; -#endif - base::MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc index c1aab88..ac5634a 100644 --- a/gpu/command_buffer/client/ring_buffer_test.cc +++ b/gpu/command_buffer/client/ring_buffer_test.cc @@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/message_loop/message_loop.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/command_buffer_service.h" @@ -17,10 +16,6 @@ #include "gpu/command_buffer/service/transfer_buffer_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - namespace gpu { using testing::Return; @@ -96,10 +91,6 @@ class BaseRingBufferTest : public testing::Test { return command_buffer_->GetLastState().token; } -#if defined(OS_MACOSX) - base::mac::ScopedNSAutoreleasePool autorelease_pool_; -#endif - base::MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/common/unittest_main.cc b/gpu/command_buffer/common/unittest_main.cc index 874bae7..17b6114 100644 --- a/gpu/command_buffer/common/unittest_main.cc +++ b/gpu/command_buffer/common/unittest_main.cc @@ -5,11 +5,16 @@ #include "base/at_exit.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/message_loop/message_loop.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_suite.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_MACOSX) +#include "base/mac/scoped_nsautorelease_pool.h" +#endif + namespace { class NoAtExitBaseTestSuite : public base::TestSuite { @@ -20,6 +25,7 @@ class NoAtExitBaseTestSuite : public base::TestSuite { }; int RunTestSuite(int argc, char** argv) { + base::MessageLoop message_loop; return NoAtExitBaseTestSuite(argc, argv).Run(); } @@ -33,6 +39,9 @@ int main(int argc, char** argv) { base::AtExitManager exit_manager; #endif base::CommandLine::Init(argc, argv); +#if defined(OS_MACOSX) + base::mac::ScopedNSAutoreleasePool autorelease_pool; +#endif testing::InitGoogleMock(&argc, argv); return base::LaunchUnitTests(argc, argv, diff --git a/gpu/command_buffer/service/gpu_scheduler_unittest.cc b/gpu/command_buffer/service/gpu_scheduler_unittest.cc index c1c0d1c..c1c2ef7 100644 --- a/gpu/command_buffer/service/gpu_scheduler_unittest.cc +++ b/gpu/command_buffer/service/gpu_scheduler_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/message_loop/message_loop.h" #include "gpu/command_buffer/common/command_buffer_mock.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" @@ -11,10 +10,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - using testing::_; using testing::DoAll; using testing::Invoke; @@ -72,10 +67,6 @@ class GpuSchedulerTest : public testing::Test { return command_buffer_->GetLastState().error; } -#if defined(OS_MACOSX) - base::mac::ScopedNSAutoreleasePool autorelease_pool_; -#endif - base::MessageLoop message_loop; scoped_ptr<MockCommandBuffer> command_buffer_; scoped_refptr<Buffer> shared_memory_buffer_; int32* buffer_; diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc index e4ed83d..0196e3b 100644 --- a/gpu/command_buffer/tests/gl_manager.cc +++ b/gpu/command_buffer/tests/gl_manager.cc @@ -302,7 +302,7 @@ void GLManager::InitializeWithCommandLine(const GLManager::Options& options, decoder_->set_engine(gpu_scheduler_.get()); - surface_ = gfx::GLSurface::CreateOffscreenGLSurface(options.size); + surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); ASSERT_TRUE(surface_.get() != NULL) << "could not create offscreen surface"; if (base_context_) { diff --git a/gpu/command_buffer/tests/gl_tests_main.cc b/gpu/command_buffer/tests/gl_tests_main.cc index 7b7d8d86..6ac5719 100644 --- a/gpu/command_buffer/tests/gl_tests_main.cc +++ b/gpu/command_buffer/tests/gl_tests_main.cc @@ -24,7 +24,14 @@ namespace { int RunHelper(base::TestSuite* testSuite) { +#if defined(USE_OZONE) + base::MessageLoopForUI main_loop; +#else base::MessageLoopForIO message_loop; +#endif + gfx::GLSurface::InitializeOneOff(); + ::gles2::Initialize(); + gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess()); return testSuite->Run(); } @@ -39,9 +46,6 @@ int main(int argc, char** argv) { #if defined(OS_MACOSX) base::mac::ScopedNSAutoreleasePool pool; #endif - gfx::GLSurface::InitializeOneOff(); - ::gles2::Initialize(); - gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess()); testing::InitGoogleMock(&argc, argv); return base::LaunchUnitTestsSerially( argc, |