Painter subpixel fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@887 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-02-22 09:50:16 +00:00
parent 55f3632c9f
commit 95faf85bd3
3 changed files with 16 additions and 4 deletions

View file

@ -77,6 +77,7 @@ void SubpixelFiller::Start(int minx, int maxx)
sbuffer[0] = sbuffer[1] = sbuffer[2] = sbuffer[3] =
sbuffer[4] = sbuffer[5] = sbuffer[6] = sbuffer[7] = 0;
v = sbuffer + 3 + minx % 3;
end = v + maxx + 1;
if(ss) {
int xx = maxx / 3;
ss->Get(buffer, x, y, xx - x + 2);
@ -134,8 +135,11 @@ void SubpixelFiller::Render(int val, int len)
void SubpixelFiller::End()
{
int n = (3333333 - (v - begin)) % 3;
while(n--)
// int n = (3333333 - (v - begin)) % 3;
// while(n--)
if(v < end)
Render(0);
if(v < end)
Render(0);
int16 *q = begin;
while(q < v) {

View file

@ -24,7 +24,7 @@ struct SpanFiller : Rasterizer::Filler {
struct SubpixelFiller : Rasterizer::Filler {
int16 *sbuffer;
int16 *begin;
int16 *begin, *end;
RGBA *t;
int16 *v;
RGBA *s;

View file

@ -30,7 +30,7 @@ static inline byte *sSpan(byte *t, int c, int& len)
void BufferPainter::FinishMask()
{
Buffer<byte> wb(2 * ib.GetWidth());
Buffer<byte> wb(quality == QUALITY_SUBPIXEL ? 6 * ib.GetWidth() : 2 * ib.GetWidth());
bool creating = false;
if(!attr.hasclip) {
clip.Add().Alloc(ib.GetHeight());
@ -53,18 +53,26 @@ void BufferPainter::FinishMask()
if(val == 0) {
if(c256) t = sSpan(t, 128, c256);
c0++;
if(quality == QUALITY_SUBPIXEL)
c0 += 2;
full = false;
}
else
if(val == 256) {
if(c0) t = sSpan(t, 0, c0);
c256++;
if(quality == QUALITY_SUBPIXEL)
c256 += 2;
empty = false;
}
else {
if(c256) t = sSpan(t, 128, c256);
if(c0) t = sSpan(t, 0, c0);
*t++ = val;
if(quality == QUALITY_SUBPIXEL) {
*t++ = val;
*t++ = val;
}
full = empty = false;
}
s++;