blob: b1b15b05f87fe6b5de00a5e13268d70fd1e3ff46 [file] [log] [blame]
#ifndef sw_FrameBufferAndroid_hpp
#define sw_FrameBufferAndroid_hpp
#include "Main/FrameBuffer.hpp"
#include "Common/Debug.hpp"
#include <hardware/gralloc.h>
#include <system/window.h>
namespace sw
{
class FrameBufferAndroid : public FrameBuffer
{
public:
FrameBufferAndroid(ANativeWindow* window, int width, int height);
~FrameBufferAndroid();
virtual void flip(void *source, Format format) {blit(source, 0, 0, format);};
virtual void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format format);
virtual void *lock();
virtual void unlock();
bool setSwapRectangle(int l, int t, int w, int h);
private:
ANativeWindow* nativeWindow;
ANativeWindowBuffer* buffer;
gralloc_module_t const* gralloc;
};
}
#endif // sw_FrameBufferAndroid