Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / ozone / ui / gfx / surface_factory_wayland.h
1 // Copyright 2014 Intel Corporation. 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 OZONE_UI_GFX_SURFACE_FACTORY_WAYLAND_H_
6 #define OZONE_UI_GFX_SURFACE_FACTORY_WAYLAND_H_
7
8 #include "ui/gfx/ozone/surface_factory_ozone.h"
9
10 #include "ui/gfx/gfx_export.h"
11
12 namespace gfx {
13
14 class GFX_EXPORT SurfaceFactoryWayland : public gfx::SurfaceFactoryOzone {
15  public:
16   SurfaceFactoryWayland();
17   virtual ~SurfaceFactoryWayland();
18
19   virtual SurfaceFactoryOzone::HardwareState InitializeHardware() OVERRIDE;
20   virtual intptr_t GetNativeDisplay() OVERRIDE;
21   virtual void ShutdownHardware() OVERRIDE;
22   // GetAcceleratedWidget return's a opaque handle associated with a accelerated
23   // widget.
24   virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
25   // RealizeAcceleratedWidget takes opaque handle as parameter and returns
26   // eglwindow assosicated with it.
27   virtual gfx::AcceleratedWidget RealizeAcceleratedWidget(
28     gfx::AcceleratedWidget w) OVERRIDE;
29   virtual bool LoadEGLGLES2Bindings(
30     gfx::SurfaceFactoryOzone::AddGLLibraryCallback add_gl_library,
31     gfx::SurfaceFactoryOzone::SetGLGetProcAddressProcCallback
32         proc_address) OVERRIDE;
33   // Returns true if resizing of eglwindow associated with opaque handle was
34   // successful else returns false.
35   virtual bool AttemptToResizeAcceleratedWidget(
36       gfx::AcceleratedWidget w, const gfx::Rect& bounds) OVERRIDE;
37   virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider(
38       gfx::AcceleratedWidget w) OVERRIDE;
39   virtual bool SchedulePageFlip(gfx::AcceleratedWidget w) OVERRIDE;
40   virtual const int32* GetEGLSurfaceProperties(
41       const int32* desired_list) OVERRIDE;
42
43  private:
44   unsigned last_realized_widget_handle_;
45
46   DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryWayland);
47 };
48
49 }  // namespace gfx
50
51 #endif  // OZONE_UI_GFX_SURFACE_FACTORY_WAYLAND_H_