| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef ANDROID_GUI_SURFACE_H |
| 18 |
#define ANDROID_GUI_SURFACE_H |
| 19 |
|
| 20 |
#include <gui/IGraphicBufferProducer.h> |
| 21 |
#include <ui/ANativeObjectBase.h> |
| 22 |
#include <utils/RefBase.h> |
| 23 |
#include <system/window.h> |
| 24 |
|
| 25 |
namespace android { |
| 26 |
|
| 27 |
class Surface : public ANativeObjectBase<ANativeWindow, Surface, RefBase> { |
| 28 |
public: |
| 29 |
explicit Surface(const sp<IGraphicBufferProducer>& bufferProducer, |
| 30 |
bool controlledByApp = false) { |
| 31 |
ANativeWindow::perform = hook_perform; |
| 32 |
} |
| 33 |
static bool isValid(const sp<Surface>& surface) { return surface != nullptr; } |
| 34 |
void allocateBuffers() {} |
| 35 |
|
| 36 |
uint64_t getNextFrameNumber() const { return 0; } |
| 37 |
|
| 38 |
int setScalingMode(int mode) { return 0; } |
| 39 |
|
| 40 |
virtual int disconnect(int api, |
| 41 |
IGraphicBufferProducer::DisconnectMode mode = |
| 42 |
IGraphicBufferProducer::DisconnectMode::Api) { |
| 43 |
return 0; |
| 44 |
} |
| 45 |
|
| 46 |
virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds) { |
| 47 |
|
| 48 |
return 0; |
| 49 |
} |
| 50 |
virtual int unlockAndPost() { return 0; } |
| 51 |
virtual int query(int what, int* value) const { return 0; } |
| 52 |
|
| 53 |
protected: |
| 54 |
virtual ~Surface() {} |
| 55 |
|
| 56 |
static int hook_perform(ANativeWindow* window, int operation, ...) { return 0; } |
| 57 |
|
| 58 |
private: |
| 59 |
|
| 60 |
Surface& operator=(const Surface& rhs); |
| 61 |
Surface(const Surface& rhs); |
| 62 |
}; |
| 63 |
|
| 64 |
} |
| 65 |
|
| 66 |
#endif |