summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-23 01:22:29 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-23 01:22:29 +0000
commitba4991cc194dafd867a000fe410b7fce29b3b64d (patch)
tree54d5dfeefa4259acc672dd8c865d117e2fa6eac8 /apps/plugins
parent6876336fee5c03514b9d67c43c424c9aaa1414eb (diff)
downloadrockbox-ba4991cc194dafd867a000fe410b7fce29b3b64d.tar.gz
rockbox-ba4991cc194dafd867a000fe410b7fce29b3b64d.zip
Apply same optimisation as for the core lcd drivers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8797 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/lib/gray_draw.c57
1 files changed, 38 insertions, 19 deletions
diff --git a/apps/plugins/lib/gray_draw.c b/apps/plugins/lib/gray_draw.c
index b842658bd7..4222d80dc1 100644
--- a/apps/plugins/lib/gray_draw.c
+++ b/apps/plugins/lib/gray_draw.c
@@ -190,9 +190,10 @@ void gray_hline(int x1, int x2, int y)
190/* Draw a vertical line (optimised) */ 190/* Draw a vertical line (optimised) */
191void gray_vline(int x, int y1, int y2) 191void gray_vline(int x, int y1, int y2)
192{ 192{
193 int y, bits; 193 int y;
194 int bits = 0;
194 unsigned char *dst; 195 unsigned char *dst;
195 bool fillopt; 196 bool fillopt = false;
196 void (*pfunc)(unsigned char *address); 197 void (*pfunc)(unsigned char *address);
197 198
198 /* direction flip */ 199 /* direction flip */
@@ -213,14 +214,23 @@ void gray_vline(int x, int y1, int y2)
213 y1 = 0; 214 y1 = 0;
214 if (y2 >= _gray_info.height) 215 if (y2 >= _gray_info.height)
215 y2 = _gray_info.height - 1; 216 y2 = _gray_info.height - 1;
216 217
217 bits = _gray_info.fg_brightness; 218 if (_gray_info.drawmode & DRMODE_INVERSEVID)
218 fillopt = (_gray_info.drawmode & DRMODE_INVERSEVID) ? 219 {
219 (_gray_info.drawmode & DRMODE_BG) : 220 if (_gray_info.drawmode & DRMODE_BG)
220 (_gray_info.drawmode & DRMODE_FG); 221 {
221 if (fillopt &&(_gray_info.drawmode & DRMODE_INVERSEVID)) 222 fillopt = true;
222 bits = _gray_info.bg_brightness; 223 bits = _gray_info.bg_brightness;
223 224 }
225 }
226 else
227 {
228 if (_gray_info.drawmode & DRMODE_FG)
229 {
230 fillopt = true;
231 bits = _gray_info.fg_brightness;
232 }
233 }
224 pfunc = _gray_pixelfuncs[_gray_info.drawmode]; 234 pfunc = _gray_pixelfuncs[_gray_info.drawmode];
225 dst = &_gray_info.cur_buffer[MULU16(x, _gray_info.height) + y1]; 235 dst = &_gray_info.cur_buffer[MULU16(x, _gray_info.height) + y1];
226 236
@@ -253,9 +263,9 @@ void gray_drawrect(int x, int y, int width, int height)
253/* Fill a rectangular area */ 263/* Fill a rectangular area */
254void gray_fillrect(int x, int y, int width, int height) 264void gray_fillrect(int x, int y, int width, int height)
255{ 265{
256 int bits; 266 int bits = 0;
257 unsigned char *dst, *dst_end; 267 unsigned char *dst, *dst_end;
258 bool fillopt; 268 bool fillopt = false;
259 void (*pfunc)(unsigned char *address); 269 void (*pfunc)(unsigned char *address);
260 270
261 /* nothing to draw? */ 271 /* nothing to draw? */
@@ -279,13 +289,22 @@ void gray_fillrect(int x, int y, int width, int height)
279 if (y + height > _gray_info.height) 289 if (y + height > _gray_info.height)
280 height = _gray_info.height - y; 290 height = _gray_info.height - y;
281 291
282 bits = _gray_info.fg_brightness; 292 if (_gray_info.drawmode & DRMODE_INVERSEVID)
283 fillopt = (_gray_info.drawmode & DRMODE_INVERSEVID) ? 293 {
284 (_gray_info.drawmode & DRMODE_BG) : 294 if (_gray_info.drawmode & DRMODE_BG)
285 (_gray_info.drawmode & DRMODE_FG); 295 {
286 if (fillopt &&(_gray_info.drawmode & DRMODE_INVERSEVID)) 296 fillopt = true;
287 bits = _gray_info.bg_brightness; 297 bits = _gray_info.bg_brightness;
288 298 }
299 }
300 else
301 {
302 if (_gray_info.drawmode & DRMODE_FG)
303 {
304 fillopt = true;
305 bits = _gray_info.fg_brightness;
306 }
307 }
289 pfunc = _gray_pixelfuncs[_gray_info.drawmode]; 308 pfunc = _gray_pixelfuncs[_gray_info.drawmode];
290 dst = &_gray_info.cur_buffer[MULU16(x, _gray_info.height) + y]; 309 dst = &_gray_info.cur_buffer[MULU16(x, _gray_info.height) + y];
291 dst_end = dst + MULU16(width, _gray_info.height); 310 dst_end = dst + MULU16(width, _gray_info.height);