Commit 274eb320 authored by tiago.vignatti's avatar tiago.vignatti Committed by Commit bot

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}
parent 69eba06c
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
#include "ui/gl/gpu_timing.h" #include "ui/gl/gpu_timing.h"
#include "ui/gl/scoped_make_current.h" #include "ui/gl/scoped_make_current.h"
#if defined(USE_OZONE)
#include "base/message_loop/message_loop.h"
#endif
namespace gpu { namespace gpu {
namespace { namespace {
...@@ -171,10 +175,15 @@ class TextureUploadPerfTest : public testing::Test { ...@@ -171,10 +175,15 @@ class TextureUploadPerfTest : public testing::Test {
// Overridden from testing::Test // Overridden from testing::Test
void SetUp() override { 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(); static bool gl_initialized = gfx::GLSurface::InitializeOneOff();
DCHECK(gl_initialized); DCHECK(gl_initialized);
// Initialize an offscreen surface and a gl context. // 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 gl_context_ = gfx::GLContext::CreateGLContext(NULL, // share_group
surface_.get(), surface_.get(),
gfx::PreferIntegratedGpu); gfx::PreferIntegratedGpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment