Chromium Code Reviews| Index: ui/gl/init/gl_initializer.h |
| diff --git a/ui/gl/init/gl_initializer.h b/ui/gl/init/gl_initializer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c8933565b1d33e59316afd4e396ffc37f2d6c1a5 |
| --- /dev/null |
| +++ b/ui/gl/init/gl_initializer.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_GL_INIT_GL_INITIALIZER_H_ |
| +#define UI_GL_INIT_GL_INITIALIZER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "ui/gl/gl_implementation.h" |
| +#include "ui/gl/init/gl_init_export.h" |
| + |
| +namespace gl { |
| +namespace init { |
| + |
| +// Class to encapsulate code for GL initialization. To perform GL initialization |
| +// you want to call gl::init::InitializeGLOneOff() or for tests possibly |
| +// gl::init::GLInitializer::InitializeOneOffImplementation(...). |
| +class GL_INIT_EXPORT GLInitializer { |
|
piman
2016/06/03 00:47:05
nit: is a class needed at all? If it only has stat
kylechar
2016/06/03 13:41:21
Yep, it was just to hide InitializeOneOffPlatform
|
| + public: |
| + GLInitializer() = delete; |
| + |
| + // Performs generic one-off GL initialization, calling into the appropriate |
| + // platform dependent initialization code. |
| + static bool InitializeOneOffImplementation(GLImplementation impl, |
| + bool fallback_to_osmesa, |
| + bool gpu_service_logging, |
| + bool disable_gl_drawing); |
| + |
| + private: |
| + // Performs platform dependent one-off GL initialization, calling into the |
| + // appropriate GLSurface code to initialize it. This is only called from |
| + // InitializeOneOffImplementation(). |
| + static bool InitializeOneOffPlatform(); |
| +}; |
| + |
| +} // namespace init |
| +} // namespace gl |
| + |
| +#endif // UI_GL_INIT_GL_INITIALIZER_H_ |