You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB

/*
* 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 <memory>
#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> &roundInfo);
const std::unique_ptr<RoundInfo>& GetRoundInfo() const;
void SetRectInfo(std::unique_ptr<RectInfo> &rectInfo);
const std::unique_ptr<RectInfo>& GetRectInfo() const;
void SetTextInfo(std::unique_ptr<TextInfo> &textInfo);
const std::unique_ptr<TextInfo>& GetTextInfo() const;
void SetBlitInfo(std::unique_ptr<BlitInfo> &blitInfo);
const std::unique_ptr<BlitInfo>& GetBlitInfo() const;
private:
Cmd mCmd;
EGL_U32 mFboHandleIndex;
std::unique_ptr<RoundInfo> mRoundInfo;
std::unique_ptr<RectInfo> mRectInfo;
std::unique_ptr<TextInfo> mTextInfo;
std::unique_ptr<BlitInfo> mBlitInfo;
std::unique_ptr<DolGLSemaphore> resultSemaphore;
bool isSyncProc;
};
}; // namespace dolgles
#endif // end DRAW_CMD_H