Chromium Code Reviews| Index: chromecast/public/cast_egl_platform.h |
| diff --git a/chromecast/ozone/cast_egl_platform.h b/chromecast/public/cast_egl_platform.h |
| similarity index 64% |
| rename from chromecast/ozone/cast_egl_platform.h |
| rename to chromecast/public/cast_egl_platform.h |
| index 624750919989a19037dfb7d9ecaced2ca8b5eb51..5c03598d57c7b70fff49361fc7ef869a92eecd0a 100644 |
| --- a/chromecast/ozone/cast_egl_platform.h |
| +++ b/chromecast/public/cast_egl_platform.h |
| @@ -2,32 +2,31 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROMECAST_OZONE_CAST_EGL_PLATFORM_H_ |
| -#define CHROMECAST_OZONE_CAST_EGL_PLATFORM_H_ |
| - |
| -#include "ui/ozone/public/surface_factory_ozone.h" |
| - |
| -namespace gfx { |
| -class Size; |
| -} |
| +#ifndef CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |
| +#define CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |
| namespace chromecast { |
| -namespace ozone { |
| // Interface representing all the hardware-specific elements of an Ozone |
| // implementation for Cast. Supply an implementation of this interface |
| // to OzonePlatformCast to create a complete Ozone implementation. |
| class CastEglPlatform { |
| public: |
| - typedef ui::SurfaceFactoryOzone::AddGLLibraryCallback AddGLLibraryCallback; |
| - typedef ui::SurfaceFactoryOzone::SetGLGetProcAddressProcCallback |
| - SetGLGetProcAddressProcCallback; |
| + |
| + // Avoiding Chromium types in shared library interfaces, so no gfx::Size. |
| + struct Size { |
| + Size(int width, int height) |
| + : width_(width), |
| + height_(height) {} |
| + const int width_; |
| + const int height_; |
|
byungchul
2015/04/03 06:10:07
Remove trailing '_' because they are public member
halliwell
2015/04/04 01:40:06
Done.
|
| + }; |
| virtual ~CastEglPlatform() {} |
| // Default display size is used for initial display and also as a minimum |
| // resolution for applications. |
| - virtual gfx::Size GetDefaultDisplaySize() const = 0; |
| + virtual Size GetDefaultDisplaySize() const = 0; |
| // Returns an array of EGL properties, which can be used in any EGL function |
| // used to select a display configuration. Note that all properties should be |
| @@ -42,28 +41,29 @@ class CastEglPlatform { |
| virtual bool InitializeHardware() = 0; |
| virtual void ShutdownHardware() = 0; |
| - // Called once after hardware successfully initialized. Implementation needs |
| - // to add the EGL and GLES2 libraries through add_gl_library and also supply |
| - // a pointer to eglGetProcAddress (or equivalent function). |
| - virtual bool LoadEGLGLES2Bindings( |
| - AddGLLibraryCallback add_gl_library, |
| - SetGLGetProcAddressProcCallback set_gl_get_proc_address) = 0; |
| + // These three are called once after hardware is successfully initialized. |
| + // The implementation must load the libraries containing EGL and GLES2 |
| + // bindings (return the pointer obtained from dlopen). It must also supply |
| + // a function pointer to eglGetProcAddress or equivalent. |
| + virtual void* GetEglLibrary() = 0; |
| + virtual void* GetGles2Library() = 0; |
| + |
| + typedef void* (*GLGetProcAddressProc)(const char* name); |
| + virtual GLGetProcAddressProc GetGLProcAddressProc() = 0; |
| // Create/destroy an EGLNativeDisplayType. These may be called multiple times |
|
byungchul
2015/04/03 05:58:17
Creates/destroys
halliwell
2015/04/04 01:40:06
Done.
|
| // over the object's lifetime, for example to release the display when |
| // switching to an external application. There will be at most one display |
| // type at a time. |
| - virtual intptr_t CreateDisplayType(const gfx::Size& size) = 0; |
| + virtual intptr_t CreateDisplayType(const Size& size) = 0; |
|
byungchul
2015/04/03 15:28:52
I understood that it is a subset of ui::SurfaceFac
halliwell
2015/04/04 01:40:06
I switched intptr_t usage to void*, with typedefs
|
| virtual void DestroyDisplayType(intptr_t display_type) = 0; |
| // Create/destroy an EGLNativeWindow. There will be at most one window at a |
|
byungchul
2015/04/03 05:58:17
Creates/destroys
halliwell
2015/04/04 01:40:06
Done.
|
| // time, created within a valid display type. |
| - virtual intptr_t CreateWindow(intptr_t display_type, |
| - const gfx::Size& size) = 0; |
| + virtual intptr_t CreateWindow(intptr_t display_type, const Size& size) = 0; |
| virtual void DestroyWindow(intptr_t window) = 0; |
| }; |
| -} // namespace ozone |
| } // namespace chromecast |
| -#endif // CHROMECAST_OZONE_CAST_EGL_PLATFORM_H_ |
| +#endif // CHROMECAST_PUBLIC_CAST_EGL_PLATFORM_H_ |