/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: DolGLDrawSurface * Author: * Create: 2020-01-03 */ #ifndef DRAW_CMD_H #define DRAW_CMD_H #include #include "DolGLSemaphore.h" #include "RectInfo.h" #include "RoundInfo.h" #include "TextInfo.h" #include "BlitInfo.h" namespace dolgles { enum TagCmd { SETUP_GLES_CONTEXT, RESET_GLES_CONTEXT, INIT_CMD, CONNECT_WINDOW_SURFACE_CMD, CREATE_GL_FBO_CMD, DESTORY_GL_FBO_CMD, CLEAR_GL_FBO_CMD, DRAW_FBO_CMD, BLIT_CMD, DRAW_TEXT_CMD, DISPLAY_BITMAP_CMD, DRAW_BITMAP_CMD, DRAW_RECT_CMD, DRAW_ROUND_CMD, LOAD_FONT_CMD, REFRESH_ON_SRCEEN_CMD, UNKNOWN_CMD }; using Cmd = TagCmd; class DrawCmd { public: explicit DrawCmd(Cmd cmd); ~DrawCmd(); Cmd GetCmd() const; bool IsSyncProc() const; void SetSyncProc(); void SemaphoreWait(); void SemaphoreSignal(); void SetFboHandleIndex(EGL_U32 fboHandleIndex); EGL_U32 GetFboHandleIndex() const; void SetRoundInfo(std::unique_ptr &roundInfo); const std::unique_ptr& GetRoundInfo() const; void SetRectInfo(std::unique_ptr &rectInfo); const std::unique_ptr& GetRectInfo() const; void SetTextInfo(std::unique_ptr &textInfo); const std::unique_ptr& GetTextInfo() const; void SetBlitInfo(std::unique_ptr &blitInfo); const std::unique_ptr& GetBlitInfo() const; private: Cmd mCmd; EGL_U32 mFboHandleIndex; std::unique_ptr mRoundInfo; std::unique_ptr mRectInfo; std::unique_ptr mTextInfo; std::unique_ptr mBlitInfo; std::unique_ptr resultSemaphore; bool isSyncProc; }; }; // namespace dolgles #endif // end DRAW_CMD_H