adopted to different PatternHandler version
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10900 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1b837c4b6b
commit
9e89de2ca6
@ -26,7 +26,7 @@ namespace agg
|
||||
{
|
||||
//printf("DrawingModeCopy::blend_pixel()\n");
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(cover) * int(c.a);
|
||||
int alpha = int(cover) * int(color.alpha);
|
||||
if(alpha == 255*255)
|
||||
@ -69,7 +69,7 @@ namespace agg
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
do
|
||||
{
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
p[Order::R] = color.red;
|
||||
p[Order::G] = color.green;
|
||||
p[Order::B] = color.blue;
|
||||
@ -84,7 +84,7 @@ namespace agg
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
do
|
||||
{
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
int r = p[Order::R];
|
||||
int g = p[Order::G];
|
||||
int b = p[Order::B];
|
||||
@ -119,7 +119,7 @@ printf("DrawingModeCopy::blend_vline()\n");
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
do
|
||||
{
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(*covers++) * c.a;
|
||||
int alpha = int(*covers++) * color.alpha;
|
||||
//int alpha = int(*covers++);
|
||||
@ -175,7 +175,7 @@ printf("DrawingModeCopy::blend_vline()\n");
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
do
|
||||
{
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(*covers++) * c.a;
|
||||
int alpha = int(*covers++) * color.alpha;
|
||||
//int alpha = int(*covers++);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "DrawingMode.h"
|
||||
|
||||
#define BINARY 1
|
||||
#define BINARY 0
|
||||
|
||||
namespace agg
|
||||
{
|
||||
@ -239,7 +239,46 @@ printf("DrawingModeInvert::blend_vline()\n");
|
||||
const int8u* covers,
|
||||
int8u cover)
|
||||
{
|
||||
printf("DrawingModeInvert::blend_color_hspan()\n");
|
||||
//printf("DrawingModeInvert::blend_color_hspan()\n");
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
rgb_color lowColor = fPatternHandler->LowColor().GetColor32();
|
||||
do
|
||||
{
|
||||
int alpha = colors->a * (covers ? int(*covers++) : int(cover));
|
||||
|
||||
if(alpha)
|
||||
{
|
||||
// if (colors->r != lowColor.red ||
|
||||
// colors->g != lowColor.green ||
|
||||
// colors->b != lowColor.blue) {
|
||||
|
||||
p[Order::R] = 255 - p[Order::R];
|
||||
p[Order::G] = 255 - p[Order::G];
|
||||
p[Order::B] = 255 - p[Order::B];
|
||||
// }
|
||||
/* if(alpha == 255*255)
|
||||
{
|
||||
p[Order::R] = 255 - p[Order::R];
|
||||
p[Order::G] = 255 - p[Order::G];
|
||||
p[Order::B] = 255 - p[Order::B];
|
||||
// p[Order::A] = 255 - p[Order::A];
|
||||
}
|
||||
else
|
||||
{
|
||||
int r = p[Order::R];
|
||||
int g = p[Order::G];
|
||||
int b = p[Order::B];
|
||||
// int a = p[Order::A];
|
||||
p[Order::R] = (int8u)(((((255 - r) - r) * alpha) + (r << 16)) >> 16);
|
||||
p[Order::G] = (int8u)(((((255 - g) - g) * alpha) + (g << 16)) >> 16);
|
||||
p[Order::B] = (int8u)(((((255 - b) - b) * alpha) + (b << 16)) >> 16);
|
||||
// p[Order::A] = (int8u)(((alpha + (a << 8)) - ((alpha * a) >> 8)) >> 8);
|
||||
}*/
|
||||
}
|
||||
p += 4;
|
||||
++colors;
|
||||
}
|
||||
while(--len);
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace agg
|
||||
//printf("DrawingModeOver::blend_pixel()\n");
|
||||
if (fPatternHandler->IsHighColor(x, y)) {
|
||||
int8u* p = m_rbuf->row(y) + (x << 2);
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(cover) * int(c.a);
|
||||
int alpha = int(cover) * int(color.alpha);
|
||||
if(alpha == 255*255)
|
||||
@ -121,7 +121,7 @@ printf("DrawingModeOver::blend_vline()\n");
|
||||
do
|
||||
{
|
||||
if (fPatternHandler->IsHighColor(x, y)) {
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(*covers++) * c.a;
|
||||
int alpha = int(*covers) * color.alpha;
|
||||
//int alpha = int(*covers++);
|
||||
@ -173,7 +173,7 @@ printf("DrawingModeOver::blend_vline()\n");
|
||||
do
|
||||
{
|
||||
if (fPatternHandler->IsHighColor(x, y)) {
|
||||
rgb_color color = fPatternHandler->ColorAt(x, y);
|
||||
rgb_color color = fPatternHandler->R5ColorAt(x, y);
|
||||
// int alpha = int(*covers++) * c.a;
|
||||
int alpha = int(*covers) * color.alpha;
|
||||
//int alpha = int(*covers++);
|
||||
|
Loading…
Reference in New Issue
Block a user