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 void flip(void *source, Format sourceFormat, size_t sourceStride) override {blit(source, 0, 0, sourceFormat, sourceStride);};
20 void blit(void *source, const Rect *sourceRect, const Rect *destRect, Format sourceFormat, size_t sourceStride) override;
22 void *lock() override;
23 void unlock() override;
25 bool setSwapRectangle(int l, int t, int w, int h);
28 ANativeWindow* nativeWindow;
29 ANativeWindowBuffer* buffer;
30 gralloc_module_t const* gralloc;
34 #endif // sw_FrameBufferAndroid