| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef ANDROID_GRAPHIC_BUFFER_IMPL_H |
| 21 |
#define ANDROID_GRAPHIC_BUFFER_IMPL_H |
| 22 |
|
| 23 |
#include <ui/GraphicBuffer.h> |
| 24 |
|
| 25 |
#include "draw_gl.h" |
| 26 |
|
| 27 |
namespace android { |
| 28 |
|
| 29 |
class GraphicBufferImpl { |
| 30 |
public: |
| 31 |
~GraphicBufferImpl(); |
| 32 |
|
| 33 |
static long Create(int w, int h); |
| 34 |
static void Release(long buffer_id); |
| 35 |
static int MapStatic(long buffer_id, AwMapMode mode, void** vaddr); |
| 36 |
static int UnmapStatic(long buffer_id); |
| 37 |
static void* GetNativeBufferStatic(long buffer_id); |
| 38 |
static uint32_t GetStrideStatic(long buffer_id); |
| 39 |
|
| 40 |
private: |
| 41 |
status_t Map(AwMapMode mode, void** vaddr); |
| 42 |
status_t Unmap(); |
| 43 |
status_t InitCheck() const; |
| 44 |
void* GetNativeBuffer() const; |
| 45 |
uint32_t GetStride() const; |
| 46 |
GraphicBufferImpl(uint32_t w, uint32_t h); |
| 47 |
|
| 48 |
sp<android::GraphicBuffer> mBuffer; |
| 49 |
}; |
| 50 |
|
| 51 |
} |
| 52 |
|
| 53 |
#endif |