Chromium Code Reviews| 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 | |
| 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_ | |
| OLD | NEW |