Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1460)

Unified Diff: ui/gl/init/gl_initializer.h

Issue 2024953002: Move GL one-off initialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_x11
Patch Set: Fix windows compile. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/init/gl_init.gyp ('k') | ui/gl/init/gl_initializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/gl/init/gl_init.gyp ('k') | ui/gl/init/gl_initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698