20 #include <LLDW_PAINTER_impl.h>
23 #include <LLUI_DISPLAY.h>
26 #include "ui_drawing.h"
35 void LLDW_PAINTER_IMPL_drawThickFadedPoint(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness, jint fade) {
36 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickFadedPoint)) {
37 DRAWING_Status status = DRAWING_DONE;
38 UI_LOG_DRAW_START(drawThickFadedPoint, gc, x, y, thickness, fade);
39 if ((thickness > 0) || (fade > 0)) {
40 status = UI_DRAWING_drawThickFadedPoint(gc, x, y, thickness, fade);
42 LLUI_DISPLAY_setDrawingStatus(status);
43 UI_LOG_DRAW_END(drawThickFadedPoint, status);
47 void LLDW_PAINTER_IMPL_drawThickFadedLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX, jint endY,
48 jint thickness, jint fade, DRAWING_Cap startCap, DRAWING_Cap endCap) {
49 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickFadedLine)) {
50 DRAWING_Status status = DRAWING_DONE;
51 UI_LOG_DRAW_START(drawThickFadedLine, gc, startX, startY, endX, endY, thickness, fade);
52 if ((thickness > 0) || (fade > 0)) {
53 status = UI_DRAWING_drawThickFadedLine(gc, startX, startY, endX, endY, thickness, fade, startCap, endCap);
55 LLUI_DISPLAY_setDrawingStatus(status);
56 UI_LOG_DRAW_END(drawThickFadedLine, status);
60 void LLDW_PAINTER_IMPL_drawThickFadedCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jint thickness,
62 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickFadedCircle)) {
63 DRAWING_Status status = DRAWING_DONE;
64 UI_LOG_DRAW_START(drawThickFadedCircle, gc, x, y, diameter, thickness, fade);
65 if ((thickness > 0) || (fade > 0)) {
66 status = UI_DRAWING_drawThickFadedCircle(gc, x, y, diameter, thickness, fade);
68 LLUI_DISPLAY_setDrawingStatus(status);
69 UI_LOG_DRAW_END(drawThickFadedCircle, status);
73 void LLDW_PAINTER_IMPL_drawThickFadedCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
74 jfloat startAngle, jfloat arcAngle, jint thickness, jint fade,
75 DRAWING_Cap start, DRAWING_Cap end) {
76 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickFadedCircleArc)) {
77 DRAWING_Status status = DRAWING_DONE;
78 UI_LOG_DRAW_START(drawThickFadedCircleArc, gc, x, y, diameter, (uint32_t)startAngle, (uint32_t)arcAngle,
80 if (((thickness > 0) || (fade > 0)) && (diameter > 0) && ((int32_t)arcAngle != 0)) {
81 status = UI_DRAWING_drawThickFadedCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness, fade,
84 LLUI_DISPLAY_setDrawingStatus(status);
85 UI_LOG_DRAW_END(drawThickFadedCircleArc, status);
89 void LLDW_PAINTER_IMPL_drawThickFadedEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
90 jint thickness, jint fade) {
91 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickFadedEllipse)) {
92 DRAWING_Status status = DRAWING_DONE;
93 UI_LOG_DRAW_START(drawThickFadedEllipse, gc, x, y, width, height, thickness, fade);
94 if (((thickness > 0) || (fade > 0)) && (width > 0) && (height > 0)) {
95 status = UI_DRAWING_drawThickFadedEllipse(gc, x, y, width, height, thickness, fade);
97 LLUI_DISPLAY_setDrawingStatus(status);
98 UI_LOG_DRAW_END(drawThickFadedEllipse, status);
102 void LLDW_PAINTER_IMPL_drawThickLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX, jint endY,
104 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickLine)) {
105 DRAWING_Status status = DRAWING_DONE;
106 UI_LOG_DRAW_START(drawThickLine, gc, startX, startY, endX, endY, thickness);
108 status = UI_DRAWING_drawThickLine(gc, startX, startY, endX, endY, thickness);
110 LLUI_DISPLAY_setDrawingStatus(status);
111 UI_LOG_DRAW_END(drawThickLine, status);
115 void LLDW_PAINTER_IMPL_drawThickCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jint thickness) {
116 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickCircle)) {
117 DRAWING_Status status = DRAWING_DONE;
118 UI_LOG_DRAW_START(drawThickCircle, gc, x, y, diameter, thickness);
119 if ((thickness > 0) && (diameter > 0)) {
120 status = UI_DRAWING_drawThickCircle(gc, x, y, diameter, thickness);
122 LLUI_DISPLAY_setDrawingStatus(status);
123 UI_LOG_DRAW_END(drawThickCircle, status);
127 void LLDW_PAINTER_IMPL_drawThickEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
129 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickEllipse)) {
130 DRAWING_Status status = DRAWING_DONE;
131 UI_LOG_DRAW_START(drawThickEllipse, gc, x, y, width, height, thickness);
132 if ((thickness > 0) && (width > 0) && (height > 0)) {
133 status = UI_DRAWING_drawThickEllipse(gc, x, y, width, height, thickness);
135 LLUI_DISPLAY_setDrawingStatus(status);
136 UI_LOG_DRAW_END(drawThickEllipse, status);
140 void LLDW_PAINTER_IMPL_drawThickCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter, jfloat startAngle,
141 jfloat arcAngle, jint thickness) {
142 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawThickCircleArc)) {
143 DRAWING_Status status = DRAWING_DONE;
144 UI_LOG_DRAW_START(drawThickCircleArc, gc, x, y, diameter, (uint32_t)startAngle, (uint32_t)arcAngle, thickness);
145 if ((thickness > 0) && (diameter > 0) && ((int32_t)arcAngle != 0)) {
146 status = UI_DRAWING_drawThickCircleArc(gc, x, y, diameter, startAngle, arcAngle, thickness);
148 LLUI_DISPLAY_setDrawingStatus(status);
149 UI_LOG_DRAW_END(drawThickCircleArc, status);
153 void LLDW_PAINTER_IMPL_drawFlippedImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
154 jint width, jint height, jint x, jint y, DRAWING_Flip transformation,
156 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawFlippedImage)) {
157 DRAWING_Status status = DRAWING_DONE;
158 UI_LOG_DRAW_START(drawFlippedImage, gc, UI_LOG_BUFFER(img), regionX, regionY, width, height, x, y,
159 transformation, alpha);
160 if (!LLUI_DISPLAY_isImageClosed(img) && (alpha > 0)) {
161 status = UI_DRAWING_drawFlippedImage(gc, img, regionX, regionY, width, height, x, y,
162 transformation, alpha);
164 LLUI_DISPLAY_setDrawingStatus(status);
165 UI_LOG_DRAW_END(drawFlippedImage, status);
169 void LLDW_PAINTER_IMPL_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
170 jint rotationX, jint rotationY, jfloat angle, jint alpha) {
171 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawRotatedImageNearestNeighbor)) {
172 DRAWING_Status status = DRAWING_DONE;
173 UI_LOG_DRAW_START(drawRotatedImage, gc, UI_LOG_BUFFER(img), x, y, rotationX, rotationY, (uint32_t)angle, alpha,
174 UI_LOG_NearestNeighbor);
175 if (!LLUI_DISPLAY_isImageClosed(img) && (alpha > 0)) {
176 status = UI_DRAWING_drawRotatedImageNearestNeighbor(gc, img, x, y, rotationX, rotationY, angle,
179 LLUI_DISPLAY_setDrawingStatus(status);
180 UI_LOG_DRAW_END(drawRotatedImage, status);
184 void LLDW_PAINTER_IMPL_drawRotatedImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
185 jint rotationX, jint rotationY, jfloat angle, jint alpha) {
186 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawRotatedImageBilinear)) {
187 DRAWING_Status status = DRAWING_DONE;
188 UI_LOG_DRAW_START(drawRotatedImage, gc, UI_LOG_BUFFER(img), x, y, rotationX, rotationY, (uint32_t)angle, alpha,
190 if (!LLUI_DISPLAY_isImageClosed(img) && (alpha > 0)) {
191 status = UI_DRAWING_drawRotatedImageBilinear(gc, img, x, y, rotationX, rotationY, angle, alpha);
193 LLUI_DISPLAY_setDrawingStatus(status);
194 UI_LOG_DRAW_END(drawRotatedImage, status);
198 void LLDW_PAINTER_IMPL_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
199 jfloat factorX, jfloat factorY, jint alpha) {
200 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawScaledImageNearestNeighbor)) {
201 DRAWING_Status status = DRAWING_DONE;
202 UI_LOG_DRAW_START(drawScaledImage, gc, UI_LOG_BUFFER(img), x, y, (uint32_t)factorX, (uint32_t)factorY, alpha,
203 UI_LOG_NearestNeighbor);
204 if (!LLUI_DISPLAY_isImageClosed(img) && (alpha > 0) && (factorX > 0.f) && (factorY > 0.f)) {
205 status = UI_DRAWING_drawScaledImageNearestNeighbor(gc, img, x, y, factorX, factorY, alpha);
207 LLUI_DISPLAY_setDrawingStatus(status);
208 UI_LOG_DRAW_END(drawScaledImage, status);
212 void LLDW_PAINTER_IMPL_drawScaledImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
213 jfloat factorX, jfloat factorY, jint alpha) {
214 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawScaledImageBilinear)) {
215 DRAWING_Status status = DRAWING_DONE;
216 UI_LOG_DRAW_START(drawScaledImage, gc, UI_LOG_BUFFER(img), x, y, (uint32_t)factorX, (uint32_t)factorY, alpha,
218 if (!LLUI_DISPLAY_isImageClosed(img) && (alpha > 0) && (factorX > 0.f) && (factorY > 0.f)) {
219 status = UI_DRAWING_drawScaledImageBilinear(gc, img, x, y, factorX, factorY, alpha);
221 LLUI_DISPLAY_setDrawingStatus(status);
222 UI_LOG_DRAW_END(drawScaledImage, status);
226 void LLDW_PAINTER_IMPL_drawScaledStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
227 MICROUI_Font *font, jint x, jint y, jfloat xRatio, jfloat yRatio) {
228 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawScaledStringBilinear)) {
229 DRAWING_Status status = DRAWING_DONE;
230 UI_LOG_DRAW_START(drawScaledString, gc, length, x, y, (uint32_t)xRatio, (uint32_t)yRatio, UI_LOG_Bilinear);
231 if ((length > 0) && (xRatio > 0) && (yRatio > 0)) {
232 status = UI_DRAWING_drawScaledStringBilinear(gc, chars, length, font, x, y, xRatio, yRatio);
234 LLUI_DISPLAY_setDrawingStatus(status);
235 UI_LOG_DRAW_END(drawScaledString, status);
239 void LLDW_PAINTER_IMPL_drawScaledRenderableStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
240 MICROUI_Font *font, jint width,
241 MICROUI_RenderableString *renderableString, jint x, jint y,
242 jfloat xRatio, jfloat yRatio) {
243 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawScaledRenderableStringBilinear)) {
244 DRAWING_Status status = DRAWING_DONE;
245 UI_LOG_DRAW_START(drawScaledRenderableString, gc, length, x, y, (uint32_t)xRatio, (uint32_t)yRatio,
247 if ((length > 0) && (xRatio > 0) && (yRatio > 0)) {
248 status = UI_DRAWING_drawScaledRenderableStringBilinear(gc, chars, length, font, width, renderableString, x,
251 LLUI_DISPLAY_setDrawingStatus(status);
252 UI_LOG_DRAW_END(drawScaledRenderableString, status);
256 void LLDW_PAINTER_IMPL_drawCharWithRotationBilinear(MICROUI_GraphicsContext *gc, jchar c, MICROUI_Font *font, jint x,
257 jint y, jint xRotation, jint yRotation, jfloat angle, jint alpha) {
258 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawCharWithRotationBilinear)) {
259 DRAWING_Status status = DRAWING_DONE;
260 UI_LOG_DRAW_START(drawRotatedCharacter, gc, c, x, y, xRotation, yRotation, (uint32_t)angle, (uint32_t)alpha,
263 status = UI_DRAWING_drawCharWithRotationBilinear(gc, c, font, x, y, xRotation, yRotation, angle, alpha);
265 LLUI_DISPLAY_setDrawingStatus(status);
266 UI_LOG_DRAW_END(drawRotatedCharacter, status);
270 void LLDW_PAINTER_IMPL_drawCharWithRotationNearestNeighbor(MICROUI_GraphicsContext *gc, jchar c, MICROUI_Font *font,
271 jint x, jint y, jint xRotation, jint yRotation, jfloat angle,
273 if (LLUI_DISPLAY_requestDrawing(gc, (SNI_callback)LLDW_PAINTER_IMPL_drawCharWithRotationNearestNeighbor)) {
274 DRAWING_Status status = DRAWING_DONE;
275 UI_LOG_DRAW_START(drawRotatedCharacter, gc, c, x, y, xRotation, yRotation, (uint32_t)angle, (uint32_t)alpha,
276 UI_LOG_NearestNeighbor);
278 status = UI_DRAWING_drawCharWithRotationNearestNeighbor(gc, c, font, x, y, xRotation, yRotation, angle,
281 LLUI_DISPLAY_setDrawingStatus(status);
282 UI_LOG_DRAW_END(drawRotatedCharacter, status);