OLD | NEW |
(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_ |
OLD | NEW |