#ifndef UI_GFX_OZONE_DRI_DRI_SURFACE_FACTORY_H_
#define UI_GFX_OZONE_DRI_DRI_SURFACE_FACTORY_H_
#include "base/memory/scoped_ptr.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/ozone/surface_factory_ozone.h"
#include "ui/gfx/ozone/surface_ozone.h"
namespace gfx {
class DriSurface;
class DriWrapper;
class HardwareDisplayController;
class SurfaceOzone;
class GFX_EXPORT DriSurfaceFactory : public SurfaceFactoryOzone {
public:
DriSurfaceFactory();
virtual ~DriSurfaceFactory();
virtual HardwareState InitializeHardware() OVERRIDE;
virtual void ShutdownHardware() OVERRIDE;
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
virtual scoped_ptr<SurfaceOzone> CreateSurfaceForWidget(
gfx::AcceleratedWidget w) OVERRIDE;
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE;
virtual bool SchedulePageFlip(gfx::AcceleratedWidget w);
virtual SkCanvas* GetCanvasForWidget(gfx::AcceleratedWidget w);
virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider(
gfx::AcceleratedWidget w);
void SetHardwareCursor(AcceleratedWidget window,
const SkBitmap& image,
const gfx::Point& location);
void MoveHardwareCursor(AcceleratedWidget window, const gfx::Point& location);
void UnsetHardwareCursor(AcceleratedWidget window);
private:
virtual DriSurface* CreateSurface(const gfx::Size& size);
virtual DriWrapper* CreateWrapper();
virtual bool InitializeControllerForPrimaryDisplay(
DriWrapper* drm,
HardwareDisplayController* controller);
virtual void WaitForPageFlipEvent(int fd);
void ResetCursor();
scoped_ptr<DriWrapper> drm_;
HardwareState state_;
scoped_ptr<HardwareDisplayController> controller_;
scoped_ptr<DriSurface> cursor_surface_;
SkBitmap cursor_bitmap_;
gfx::Point cursor_location_;
DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory);
};
}
#endif