Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/libpainter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2016-06-28 10:11:21 +0300
committerJay Sorg <jay.sorg@gmail.com>2016-06-28 10:11:21 +0300
commit1281c91f43c1cf65e69cf5bddd05f229139aac50 (patch)
treed675cee9da65ed22da99b37126bbb0b1d0afbf65
parent86f5248a7ee74a1c6ba3c2367766f17aa21b7b58 (diff)
fill_rect optimize
-rw-r--r--src/painter.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/painter.c b/src/painter.c
index b8d97c8..fed0ca4 100644
--- a/src/painter.c
+++ b/src/painter.c
@@ -147,9 +147,25 @@ painter_fill_rect(void *handle, struct painter_bitmap *dst,
{
int index;
int jndex;
+ int *dst32;
struct painter *pt;
pt = (struct painter *) handle;
+ if (pt->rop == PT_ROP_S)
+ {
+ if (dst->format == PT_FORMAT_a8r8g8b8)
+ {
+ for (jndex = 0; jndex < cy; jndex++)
+ {
+ dst32 = (int*)bitmap_get_ptr(dst, x, y + jndex);
+ for (index = 0; index < cx; index++)
+ {
+ dst32[index] = pt->fgcolor;
+ }
+ }
+ return PT_ERROR_NONE;
+ }
+ }
for (jndex = 0; jndex < cy; jndex++)
{
for (index = 0; index < cx; index++)