diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 845e7e3e91..c907bf38a4 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -322,7 +322,7 @@ Painter::SetDrawState(const DrawState* state, int32 xOffset, int32 yOffset) SetHighColor(state->HighColor()); SetLowColor(state->LowColor()); - if (updateDrawingMode || fPixelFormat.UsesOpCopyForText()) + if (updateDrawingMode) _UpdateDrawingMode(); } diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyText.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyText.h deleted file mode 100644 index 23b5f2b4b2..0000000000 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyText.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2006, Stephan Aßmus . All rights reserved. - * Distributed under the terms of the MIT License. - * - * DrawingMode implementing B_OP_COPY for text on B_RGBA32. - * - */ - -#ifndef DRAWING_MODE_COPY_TEXT_H -#define DRAWING_MODE_COPY_TEXT_H - -#include "DrawingModeCopy.h" - -// blend_pixel_copy_text -void -blend_pixel_copy_text(int x, int y, const color_type& c, uint8 cover, - agg_buffer* buffer, const PatternHandler* pattern) -{ - uint8* p = buffer->row_ptr(y) + (x << 2); - if (cover == 255) { - ASSIGN_COPY(p, c.r, c.g, c.b, c.a); - } else { - rgb_color l = pattern->LowColor(); - BLEND_COPY(p, c.r, c.g, c.b, cover, - l.red, l.green, l.blue); - } -} - -// blend_hline_copy_text -void -blend_hline_copy_text(int x, int y, unsigned len, - const color_type& c, uint8 cover, - agg_buffer* buffer, const PatternHandler* pattern) -{ - if (cover == 255) { - // cache the color as 32bit value - uint32 v; - uint8* p8 = (uint8*)&v; - p8[0] = (uint8)c.b; - p8[1] = (uint8)c.g; - p8[2] = (uint8)c.r; - p8[3] = 255; - // row offset as 32bit pointer - uint32* p32 = (uint32*)(buffer->row_ptr(y)) + x; - do { - *p32 = v; - p32++; - } while(--len); - } else { - uint8* p = buffer->row_ptr(y) + (x << 2); - rgb_color l = pattern->LowColor(); - do { - BLEND_COPY(p, c.r, c.g, c.b, cover, - l.red, l.green, l.blue); - p += 4; - } while(--len); - } -} - -// blend_solid_hspan_copy_text -void -blend_solid_hspan_copy_text(int x, int y, unsigned len, - const color_type& c, const uint8* covers, - agg_buffer* buffer, - const PatternHandler* pattern) -{ -//printf("blend_solid_hspan_copy_text(%d, %d)\n", x, len); -// uint8* p = buffer->row_ptr(y) + (x << 2); - uint32* p = (uint32*)(buffer->row_ptr(y) + (x << 2)); - const uint32* cache = (const uint32*)pattern->OpCopyColorCache(); -// rgb_color l = pattern->LowColor(); - do { -// if (*covers) { - *p = cache[*covers]; -// if(*covers == 255) { -// ASSIGN_COPY(p, c.r, c.g, c.b, c.a); -// } else { -// BLEND_COPY(p, c.r, c.g, c.b, *covers, -// l.red, l.green, l.blue); -// } -// } - covers++; - p++; -// p += 4; - } while(--len); -} - - - -// blend_solid_vspan_copy_text -void -blend_solid_vspan_copy_text(int x, int y, unsigned len, - const color_type& c, const uint8* covers, - agg_buffer* buffer, - const PatternHandler* pattern) -{ - uint8* p = buffer->row_ptr(y) + (x << 2); - rgb_color l = pattern->LowColor(); - do { - if (*covers) { - if (*covers == 255) { - ASSIGN_COPY(p, c.r, c.g, c.b, c.a); - } else { - BLEND_COPY(p, c.r, c.g, c.b, *covers, - l.red, l.green, l.blue); - } - } - covers++; - p += buffer->stride(); - } while(--len); -} - - -// blend_color_hspan_copy_text -void -blend_color_hspan_copy_text(int x, int y, unsigned len, - const color_type* colors, const uint8* covers, - uint8 cover, - agg_buffer* buffer, - const PatternHandler* pattern) -{ - uint8* p = buffer->row_ptr(y) + (x << 2); - rgb_color l = pattern->LowColor(); - if (covers) { - // non-solid opacity - do { - if(*covers) { - if(*covers == 255) { - ASSIGN_COPY(p, colors->r, colors->g, colors->b, colors->a); - } else { - BLEND_COPY(p, colors->r, colors->g, colors->b, *covers, - l.red, l.green, l.blue); - } - } - covers++; - p += 4; - ++colors; - } while(--len); - } else { - // solid full opcacity - if (cover == 255) { - do { - ASSIGN_COPY(p, colors->r, colors->g, colors->b, colors->a); - p += 4; - ++colors; - } while(--len); - // solid partial opacity - } else if (cover) { - do { - BLEND_COPY(p, colors->r, colors->g, colors->b, cover, - l.red, l.green, l.blue); - p += 4; - ++colors; - } while(--len); - } - } -} - -#endif // DRAWING_MODE_COPY_TEXT_H - diff --git a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyTextSUBPIX.h b/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyTextSUBPIX.h deleted file mode 100644 index a0e04d6adc..0000000000 --- a/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopyTextSUBPIX.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2006, Stephan Aßmus . - * Copyright 2008, Andrej Spielmann . - * All rights reserved. Distributed under the terms of the MIT License. - * - * DrawingMode implementing B_OP_COPY for text on B_RGBA32. - * - */ - -#ifndef DRAWING_MODE_COPY_TEXT_SUBPIX_H -#define DRAWING_MODE_COPY_TEXT_SUBPIX_H - -#include "DrawingModeCopySUBPIX.h" -#include "GlobalSubpixelSettings.h" - -// blend_solid_hspan_copy_text_subpix -void -blend_solid_hspan_copy_text_subpix(int x, int y, unsigned len, - const color_type& c, const uint8* covers, agg_buffer* buffer, - const PatternHandler* pattern) -{ -//printf("blend_solid_hspan_copy_text(%d, %d)\n", x, len); - uint8* p = buffer->row_ptr(y) + (x << 2); - rgb_color l = pattern->LowColor(); - const int subpixelL = gSubpixelOrderingRGB ? 2 : 0; - const int subpixelM = 1; - const int subpixelR = gSubpixelOrderingRGB ? 0 : 2; - do { - BLEND_COPY_SUBPIX(p, c.r, c.g, c.b, covers[subpixelL], - covers[subpixelM], covers[subpixelR], l.red, l.green, l.blue); - covers += 3; - p += 4; - x++; - len -= 3; - } while (len); -} - -#endif // DRAWING_MODE_COPY_TEXT_SUBPIX_H - diff --git a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp index 40ca5d3505..8effd38589 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp +++ b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.cpp @@ -26,7 +26,6 @@ #include "DrawingModeBlend.h" #include "DrawingModeCopy.h" #include "DrawingModeCopySolid.h" -#include "DrawingModeCopyText.h" #include "DrawingModeErase.h" #include "DrawingModeInvert.h" #include "DrawingModeMin.h" @@ -46,7 +45,6 @@ #include "DrawingModeBlendSUBPIX.h" #include "DrawingModeCopySUBPIX.h" #include "DrawingModeCopySolidSUBPIX.h" -#include "DrawingModeCopyTextSUBPIX.h" #include "DrawingModeEraseSUBPIX.h" #include "DrawingModeInvertSUBPIX.h" #include "DrawingModeMinSUBPIX.h" @@ -139,7 +137,6 @@ PixelFormat::PixelFormat(agg::rendering_buffer& rb, const PatternHandler* handler) : fBuffer(&rb), fPatternHandler(handler), - fUsesOpCopyForText(false), fBlendPixel(blend_pixel_empty), fBlendHLine(blend_hline_empty), @@ -162,10 +159,9 @@ void PixelFormat::SetDrawingMode(drawing_mode mode, source_alpha alphaSrcMode, alpha_function alphaFncMode, bool text) { - fUsesOpCopyForText = false; switch (mode) { - // these drawing modes discard source pixels - // which have the current low color + // These drawing modes discard source pixels + // which have the current low color. case B_OP_OVER: if (fPatternHandler->IsSolid()) { fBlendPixel = blend_pixel_over_solid; @@ -207,21 +203,10 @@ PixelFormat::SetDrawingMode(drawing_mode mode, source_alpha alphaSrcMode, fBlendColorHSpan = blend_color_hspan_select; break; - // in these drawing modes, the current high - // and low color are treated equally + // In these drawing modes, the current high + // and low color are treated equally. case B_OP_COPY: - if (text) { - fBlendPixel = blend_pixel_copy_text; - fBlendHLine = blend_hline_copy_text; - fBlendSolidHSpanSubpix = blend_solid_hspan_copy_text_subpix; - fBlendSolidHSpan = blend_solid_hspan_copy_text; - fBlendSolidVSpan = blend_solid_vspan_copy_text; - fBlendColorHSpan = blend_color_hspan_copy_text; - // set the special flag so that Painter - // knows if an update is needed even though - // "nothing changed" - fUsesOpCopyForText = true; - } else if (fPatternHandler->IsSolid()) { + if (fPatternHandler->IsSolid()) { fBlendPixel = blend_pixel_copy_solid; fBlendHLine = blend_hline_copy_solid; fBlendSolidHSpanSubpix = blend_solid_hspan_copy_solid_subpix; @@ -278,7 +263,7 @@ PixelFormat::SetDrawingMode(drawing_mode mode, source_alpha alphaSrcMode, fBlendColorHSpan = blend_color_hspan_max; break; - // this drawing mode is the only one considering + // This drawing mode is the only one considering // alpha at all. In B_CONSTANT_ALPHA, the alpha // value from the current high color is used for // all computations. In B_PIXEL_ALPHA, the alpha diff --git a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.h b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.h index d0c8bc7689..2d83b5420f 100644 --- a/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.h +++ b/src/servers/app/drawing/Painter/drawing_modes/PixelFormat.h @@ -71,9 +71,6 @@ class PixelFormat { alpha_function alphaFncMode, bool text); - inline bool UsesOpCopyForText() const - { return fUsesOpCopyForText; } - // AGG "pixel format" interface inline unsigned width() const { return fBuffer->width(); } @@ -140,7 +137,6 @@ class PixelFormat { private: agg::rendering_buffer* fBuffer; const PatternHandler* fPatternHandler; - bool fUsesOpCopyForText; blend_pixel_f fBlendPixel; blend_line fBlendHLine;