1 #ifndef sw_FrameBufferAndroid_hpp
2 #define sw_FrameBufferAndroid_hpp
4 #include "Main/FrameBuffer.hpp"
5 #include "Common/Debug.hpp"
7 #include <hardware/gralloc.h>
8 #include <system/window.h>
12 class FrameBufferAndroid : public FrameBuffer
15 FrameBufferAndroid(ANativeWindow* window, int width, int height);
17 ~FrameBufferAndroid();
19 virtual void flip(void *source, Format format) {blit(source, 0, 0, format);};
20 virtual void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format format);
23 virtual void unlock();
25 bool setSwapRectangle(int l, int t, int w, int h);
28 int lock(ANativeWindowBuffer* buf, int usage, void** vaddr);
29 int unlock(ANativeWindowBuffer* buf);
31 ANativeWindow* nativeWindow;
32 ANativeWindowBuffer* buffer;
33 gralloc_module_t const* gralloc;
38 #endif // sw_FrameBufferAndroid