2 Copyright 2004-2005 Chris Tallon, 2006,2011-2012 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <EGL/eglext.h>
29 #include <VG/openvg.h>
34 #include "osdvector.h"
44 #include FT_FREETYPE_H
49 OVGcreateImagePalette,
62 unsigned int param1,param2,param3;
63 unsigned int id; //only set an id if you are waiting
66 struct OpenVGResponse{
72 class OsdOpenVG : public OsdVector, public Thread_TYPE
78 int init(void* device);
85 float getFontHeight();
86 float getCharWidth(wchar_t c);
87 void imageUploadLine(ImageIndex index,unsigned int j,unsigned int width,void *data);
89 int getFontNames(const char *** names,const char *** names_keys);
91 virtual void setFont(const char * fontname);
95 /*osd vector implementation*/
96 void destroyImageRef(ImageIndex index);
97 ImageIndex createJpeg(const char* fileName, int *width,int *height);
98 ImageIndex createMonoBitmap(void *base,int width,int height);
99 ImageIndex createImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data);
100 void destroyStyleRef(unsigned int index);
101 unsigned int createStyleRef(const DrawStyle &c);
102 unsigned int createColorRef(const Colour &c);
104 void drawSetTrans(SurfaceCommands & sc);
105 void executeDrawCommand(SVGCommand & command);
109 VGPath std_paths[Point+1];
110 long long lastrendertime;
111 void InternalRendering();
117 pthread_cond_t vgtaskCond;
118 pthread_mutex_t vgtaskCondMutex;
119 deque<OpenVGCommand> vgcommands;
120 deque<OpenVGResponse> vgresponses;
122 bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
123 unsigned int putOpenVGCommand(OpenVGCommand& comm,bool wait);
124 unsigned int handleTask(OpenVGCommand& command);
125 void purgeAllReferences();
126 unsigned int wait_id;
128 FT_Library ft_library;
133 int loadFont(bool fontchange);
134 map<unsigned int,float> font_exp_x;
135 vector<char*> fontnames;
136 vector<char*> fontnames_keys;
139 unsigned int loadTTchar(cTeletextChar c);
140 map<unsigned int,int> tt_font_chars;
145 void threadPostStopCleanup();
150 uint32_t display_height;
151 uint32_t display_width;
152 DISPMANX_DISPLAY_HANDLE_T bcm_display;
153 DISPMANX_ELEMENT_HANDLE_T bcm_element;
154 // DISPMANX_ELEMENT_HANDLE_T bcm_background;
155 // DISPMANX_RESOURCE_HANDLE_T bcm_backres;
160 EGLDisplay egl_display;
161 EGLSurface egl_surface;
162 EGLContext egl_context;
163 EGLConfig egl_ourconfig;
165 float aspect_correction;
166 bool freetype_inited;