diff options
Diffstat (limited to 'graphics/VectorRendererSpec.h')
-rw-r--r-- | graphics/VectorRendererSpec.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index fe64f9774d..4ed80cb55f 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -103,7 +103,7 @@ protected: * @param alpha Alpha intensity of the pixel (0-255) */ inline void blendPixel(int x, int y, PixelType color, uint8 alpha) { - blendPixelPtr((PixelType*)Base::_activeSurface->getBasePtr(x, y), color, alpha); + blendPixelPtr((PixelType *)Base::_activeSurface->getBasePtr(x, y), color, alpha); } /** @@ -121,6 +121,24 @@ protected: inline void blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha); /** + * Blends a single pixel on the surface in the given pixel pointer, using supplied color + * and Alpha intensity. + * If the destination pixel has 0 alpha, set the color and alpha channels, + * overwriting the destination pixel entirely. + * If the destination pixel has non-zero alpha, blend dest with src. + * + * This is implemented to prevent blendPixel() to calculate the surface pointer on each call. + * Optimized drawing algorithms should call this function when possible. + * + * @see blendPixel + * @param ptr Pointer to the pixel to blend on top of + * @param color Color of the pixel + * @param alpha Alpha intensity of the pixel (0-255) + */ + inline void blendPixelDestAlphaPtr(PixelType *ptr, PixelType color, uint8 alpha); + + + /** * PRIMITIVE DRAWING ALGORITHMS * * Generic algorithms for drawing all kinds of aliased primitive shapes. @@ -172,7 +190,6 @@ protected: */ virtual void drawSquareShadow(int x, int y, int w, int h, int blur); virtual void drawRoundedSquareShadow(int x, int y, int r, int w, int h, int blur); - virtual void drawRoundedSquareFakeBevel(int x, int y, int r, int w, int h, int amount); /** * Calculates the color gradient on a given point. @@ -202,6 +219,8 @@ protected: while (first != last) blendPixelPtr(first++, color, alpha); } + void darkenFill(PixelType *first, PixelType *last); + const PixelFormat _format; const PixelType _redMask, _greenMask, _blueMask, _alphaMask; @@ -278,6 +297,10 @@ protected: // VectorRenderer::applyConvolutionMatrix(VectorRenderer::kConvolutionHardBlur, // Common::Rect(x, y, x + w + blur * 2, y + h + blur * 2)); } + + virtual void drawTabAlg(int x, int y, int w, int h, int r, + PixelType color, VectorRenderer::FillMode fill_m, + int baseLeft = 0, int baseRight = 0); }; #endif |