mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-12-22 23:00:35 +00:00
commit
0daffc53b7
@ -38,6 +38,7 @@ public:
|
||||
|
||||
virtual void OnPositionChange(WindowPositionChangeFunc func) override;
|
||||
virtual void OnSizeChange(WindowSizeChangeFunc func) override;
|
||||
virtual void OnBeforeFrameSubmit(BeforeFrameSubmitFunc func) override;
|
||||
|
||||
protected:
|
||||
virtual ~SubwindowNormalImpl() override;
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
|
||||
virtual void OnPositionChange(WindowPositionChangeFunc func) override;
|
||||
virtual void OnSizeChange(WindowSizeChangeFunc func) override;
|
||||
virtual void OnBeforeFrameSubmit(BeforeFrameSubmitFunc func) override;
|
||||
|
||||
private:
|
||||
GSError CreateWlSurface(const sptr<WlSurface> &parentWlSurface);
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
virtual void OnTypeChange(WindowTypeChangeFunc func) override;
|
||||
virtual void OnModeChange(WindowModeChangeFunc func) override;
|
||||
virtual void OnSplitStatusChange(SplitStatusChangeFunc func) override;
|
||||
virtual void OnBeforeFrameSubmit(BeforeFrameSubmitFunc func) override;
|
||||
|
||||
// pipMode
|
||||
virtual bool GetPIPMode() const override;
|
||||
|
@ -175,6 +175,11 @@ void SubwindowNormalImpl::OnSizeChange(WindowSizeChangeFunc func)
|
||||
attr.OnSizeChange(func);
|
||||
}
|
||||
|
||||
void SubwindowNormalImpl::OnBeforeFrameSubmit(BeforeFrameSubmitFunc func)
|
||||
{
|
||||
onBeforeFrameSubmitFunc = func;
|
||||
}
|
||||
|
||||
SubwindowNormalImpl::~SubwindowNormalImpl()
|
||||
{
|
||||
Destroy();
|
||||
@ -209,6 +214,10 @@ void SubwindowNormalImpl::OnBufferAvailable()
|
||||
return;
|
||||
}
|
||||
|
||||
if (onBeforeFrameSubmitFunc != nullptr) {
|
||||
onBeforeFrameSubmitFunc();
|
||||
}
|
||||
|
||||
if (csurf == nullptr || wlSurface == nullptr) {
|
||||
WMLOGFE("csurf or wlSurface is nullptr");
|
||||
return;
|
||||
|
@ -266,4 +266,9 @@ SubwindowVideoImpl::~SubwindowVideoImpl()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void SubwindowVideoImpl::OnBeforeFrameSubmit(BeforeFrameSubmitFunc func)
|
||||
{
|
||||
onBeforeFrameSubmitFunc = func;
|
||||
}
|
||||
} // namespace OHOS
|
||||
|
@ -482,6 +482,11 @@ GSError WindowImpl::OnPIPModeChange(WindowPIPModeChangeFunc func)
|
||||
return GSERROR_OK;
|
||||
}
|
||||
|
||||
void WindowImpl::OnBeforeFrameSubmit(BeforeFrameSubmitFunc func)
|
||||
{
|
||||
onBeforeFrameSubmitFunc = func;
|
||||
}
|
||||
|
||||
GSError WindowImpl::OnTouch(OnTouchFunc cb)
|
||||
{
|
||||
CHECK_DESTROY(GSERROR_DESTROYED_OBJECT);
|
||||
@ -513,6 +518,10 @@ void WindowImpl::OnBufferAvailable()
|
||||
WMLOGFI("OnBufferAvailable enter");
|
||||
CHECK_DESTROY();
|
||||
|
||||
if (onBeforeFrameSubmitFunc != nullptr) {
|
||||
onBeforeFrameSubmitFunc();
|
||||
}
|
||||
|
||||
sptr<SurfaceBuffer> sbuffer;
|
||||
int32_t flushFence;
|
||||
int64_t timestamp;
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
MOCK_METHOD1(OnVisibilityChange, void(WindowVisibilityChangeFunc func));
|
||||
MOCK_METHOD1(OnTypeChange, void(WindowTypeChangeFunc func));
|
||||
MOCK_METHOD1(OnModeChange, void(WindowModeChangeFunc func));
|
||||
MOCK_METHOD1(OnBeforeFrameSubmit, void(BeforeFrameSubmitFunc func));
|
||||
MOCK_METHOD1(OnSplitStatusChange, void(SplitStatusChangeFunc func));
|
||||
MOCK_METHOD1(OnKey, GSError(OnKeyFunc cb));
|
||||
MOCK_METHOD1(OnTouch, GSError(OnTouchFunc cb));
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
|
||||
virtual void OnPositionChange(WindowPositionChangeFunc func) = 0;
|
||||
virtual void OnSizeChange(WindowSizeChangeFunc func) = 0;
|
||||
virtual void OnBeforeFrameSubmit(BeforeFrameSubmitFunc func) = 0;
|
||||
|
||||
virtual GSError OnFrameAvailable(FrameAvailableFunc func)
|
||||
{
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
virtual void OnTypeChange(WindowTypeChangeFunc func) = 0;
|
||||
virtual void OnModeChange(WindowModeChangeFunc func) = 0;
|
||||
virtual void OnSplitStatusChange(SplitStatusChangeFunc func) = 0;
|
||||
virtual void OnBeforeFrameSubmit(BeforeFrameSubmitFunc func) = 0;
|
||||
|
||||
// pip Mode
|
||||
virtual bool GetPIPMode() const
|
||||
|
Loading…
Reference in New Issue
Block a user