From 274eb3202c59d4842c191e924577e81f14044af5 Mon Sep 17 00:00:00 2001 From: "tiago.vignatti" Date: Thu, 16 Apr 2015 14:10:18 -0700 Subject: gpu_perftests: 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 fine. BUG=423481 TEST=gpu_perftests on GBM Review URL: https://codereview.chromium.org/1086703007 Cr-Commit-Position: refs/heads/master@{#325514} --- gpu/perftests/texture_upload_perftest.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gpu/perftests') diff --git a/gpu/perftests/texture_upload_perftest.cc b/gpu/perftests/texture_upload_perftest.cc index 3a1af62..27444a4 100644 --- a/gpu/perftests/texture_upload_perftest.cc +++ b/gpu/perftests/texture_upload_perftest.cc @@ -24,6 +24,10 @@ #include "ui/gl/gpu_timing.h" #include "ui/gl/scoped_make_current.h" +#if defined(USE_OZONE) +#include "base/message_loop/message_loop.h" +#endif + namespace gpu { namespace { @@ -171,10 +175,15 @@ class TextureUploadPerfTest : public testing::Test { // Overridden from testing::Test void SetUp() override { +#if defined(USE_OZONE) + // On Ozone, the backend initializes the event system using a UI + // thread. + base::MessageLoopForUI main_loop; +#endif static bool gl_initialized = gfx::GLSurface::InitializeOneOff(); DCHECK(gl_initialized); // Initialize an offscreen surface and a gl context. - surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(4, 4)); + surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); gl_context_ = gfx::GLContext::CreateGLContext(NULL, // share_group surface_.get(), gfx::PreferIntegratedGpu); -- cgit v1.1