WidgetBackingStore.h [plain text]
#ifndef WidgetBackingStore_h
#define WidgetBackingStore_h
#include "IntRect.h"
#include "IntSize.h"
#include <wtf/FastMalloc.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#if PLATFORM(GTK)
#include <gtk/gtk.h>
#elif PLATFORM(EFL)
#include <Evas.h>
#endif
typedef struct _cairo_surface cairo_surface_t;
namespace WebCore {
#if PLATFORM(GTK)
typedef GtkWidget* PlatformWidget;
#elif PLATFORM(EFL)
typedef Evas_Object* PlatformWidget;
#endif
class WidgetBackingStore {
WTF_MAKE_NONCOPYABLE(WidgetBackingStore);
WTF_MAKE_FAST_ALLOCATED;
public:
virtual cairo_surface_t* cairoSurface() = 0;
virtual void scroll(const IntRect& scrollRect, const IntSize& scrollOffset) = 0;
const IntSize& size() { return m_size; }
WidgetBackingStore(const IntSize& size, float deviceScaleFactor)
: m_size(size)
, m_deviceScaleFactor(deviceScaleFactor)
{ }
virtual ~WidgetBackingStore() { }
protected:
IntSize m_size;
float m_deviceScaleFactor;
};
}
#endif // WidgetBackingStore_h