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

Side by Side Diff: ui/gl/init/ozone_util.h

Issue 2270463002: Add OzoneGLImpl interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo initialization changes. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GL_INIT_OZONE_UTIL_H_
6 #define UI_GL_INIT_OZONE_UTIL_H_
7
8 #include "base/macros.h"
9 #include "ui/gl/gl_implementation.h"
10 #include "ui/ozone/public/gl_ozone.h"
11 #include "ui/ozone/public/ozone_platform.h"
12 #include "ui/ozone/public/surface_factory_ozone.h"
13
14 namespace gl {
15
16 inline ui::SurfaceFactoryOzone* GetSurfaceFactory() {
piman 2016/08/31 20:05:09 nit: gl::GetSurfaceFactory doesn't make it clear t
kylechar 2016/09/01 13:57:21 Done.
17 return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
18 }
19
20 // Returns true if there is an GLOzone for the specified GL implementation.
21 inline bool HasGLOzone(GLImplementation impl) {
22 return GetSurfaceFactory()->GetGLOzone(impl) != nullptr;
piman 2016/08/31 20:05:09 Is the plan to have this always be true? If not, c
kylechar 2016/09/01 13:57:21 I think that yes, it would always be true. I could
piman 2016/09/01 17:43:04 Right, I would like that in the end state we don't
23 }
24
25 // Returns true if there is an GLOzone for the set GL implementation.
26 inline bool HasGLOzone() {
27 return HasGLOzone(GetGLImplementation());
28 }
29
30 // Returns the GLOzone for the specified GL implementation or null if none
31 // exists.
32 inline ui::GLOzone* GetGLOzone(GLImplementation impl) {
33 return GetSurfaceFactory()->GetGLOzone(impl);
34 }
35
36 // Returns the GLOzone for the set GL implementation or null if none exists.
37 inline ui::GLOzone* GetGLOzone() {
38 return GetGLOzone(GetGLImplementation());
39 }
40
41 } // namespace gl
42
43 #endif // UI_GL_INIT_OZONE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698