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

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: Address comments. 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
« no previous file with comments | « ui/gl/init/gl_initializer_ozone.cc ('k') | ui/gl/test/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 namespace init {
16
17 inline ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() {
18 return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
19 }
20
21 // Returns true if there is an GLOzone for the specified GL implementation.
22 inline bool HasGLOzone(GLImplementation impl) {
23 return GetSurfaceFactoryOzone()->GetGLOzone(impl) != nullptr;
24 }
25
26 // Returns true if there is an GLOzone for the set GL implementation.
27 inline bool HasGLOzone() {
28 return HasGLOzone(GetGLImplementation());
29 }
30
31 // Returns the GLOzone for the specified GL implementation or null if none
32 // exists.
33 inline ui::GLOzone* GetGLOzone(GLImplementation impl) {
34 return GetSurfaceFactoryOzone()->GetGLOzone(impl);
35 }
36
37 // Returns the GLOzone for the set GL implementation or null if none exists.
38 inline ui::GLOzone* GetGLOzone() {
39 return GetGLOzone(GetGLImplementation());
40 }
41
42 } // namespace init
43 } // namespace gl
44
45 #endif // UI_GL_INIT_OZONE_UTIL_H_
OLDNEW
« no previous file with comments | « ui/gl/init/gl_initializer_ozone.cc ('k') | ui/gl/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698