/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: DolGLDrawSurface * Author: * Create: 2019-08-22 */ #ifndef DOL_GL_DRAW_SURFACE_H #define DOL_GL_DRAW_SURFACE_H #include "GLDrawThread.h" namespace dolgles { // DolGLES function #define DOL_ENDABLE_DRAW_TEXT ENDABLE_DRAW_TEXT #define DOL_ENDABLE_BLIT ENDABLE_BLIT #define DOL_ENDABLE_DISPLAY_BITMAP ENDABLE_DISPLAY_BITMAP #define DOL_ENDABLE_DRAW_RECT ENDABLE_DRAW_RECT #define DOL_ENDABLE_DISPLAY_FBO ENDABLE_DISPLAY_FBO #define DOL_ENDABLE_FBO ENDABLE_FBO #define DOL_ENDABLE_DRAW_ROUND ENDABLE_DRAW_ROUND struct TagDolRectInfo { EGL_U32 x; EGL_U32 y; EGL_U32 width; EGL_U32 height; }; using DolRectInfo = TagDolRectInfo; struct TagDolRoundInfo { EGL_U32 x; EGL_U32 y; EGL_U32 rw; // oval radius of horizontal axle EGL_U32 rh; // oval radius of vertical axle }; using DolRoundInfo = TagDolRoundInfo; struct TagDolBlitInfo { EGL_U32 srcFBO; EGL_U32 dstFBO; DolRectInfo srcRect; DolRectInfo dstRect; }; using DolBlitInfo = TagDolBlitInfo; struct TagDolColorRGBA { EGL_U8 red; EGL_U8 green; EGL_U8 blue; EGL_U8 alpha; }; using DolColorRGBA = TagDolColorRGBA; struct TagDolTextInfo { const EGL_CHAR16 *text; EGL_U32 textLen; DolColorRGBA fgColor; DolColorRGBA bgColor; EGL_U8 justify; EGL_U32 fontSize; bool isBold; bool isUnderLine; bool isItalic; }; using DolTextInfo = TagDolTextInfo; struct TagDolBitmapInfo { void *bitmap; EGL_S32 format; DolRectInfo srcRect; DolRectInfo dstRect; }; using DolBitmapInfo = TagDolBitmapInfo; enum { DOL_NO_ERROR = 0, // EGL create context error DOL_EGL_GET_DISPLAY_FAIL = 1, DOL_EGL_INIT_FAIL = 2, DOL_EGL_CHOOSE_CONFIG_FAIL = 3, DOL_EGL_CREATE_CONTEXT_FAIL = 4, DOL_EGL_CREATE_WINDOW_FAIL = 5, DOL_EGL_NO_INIT_SURFACE = 6, // create FBO error DOL_FRAMEBUFFER_COMPLETE = 10, DOL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 11, DOL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 12, DOL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 13, DOL_FRAMEBUFFER_UNSUPPORTED = 14, DOL_FRAMEBUFFER_NUM_IS_MAX = 15, DOL_FRAMEBUFFER_INVALID = 16, // GL error DOL_CREATE_SHADER_PROGRAM_FAIL = 20, DOL_CREATE_TEXTURE_FAIL = 21, // Freetype error DOL_FREETYPE_INIT_FAIL = 30, DOL_FREETYPE_NEW_FACE_FALI = 31, DOL_FREETYPE_CALCULATE_TEXTURE_SIZE_FAIL = 32, DOL_DRAW_CMD_QUEUE_IS_EMPTY = 50, DOL_UNKNOWN_ERROR = 100, DOL_INVALID_PARAM = 101, DOL_NO_INIT_GLES = 102, DOL_NULL_POINTER_ERROR = 103 }; typedef enum { CAPTION_OSD_PF_CLUT8 = 0, /* * drawThread; EGLNativeWindowType mNativeWindow; EGL_U32 winWidth; EGL_U32 winHeight; mutex mMutex; }; }; // namespace dolgles #endif // end DOL_GL_DRAW_SURFACE_H