Subversion Repositories tpanel

Rev

Rev 401 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 401 Rev 404
Line 829... Line 829...
829
                *wpix = SK_ColorTRANSPARENT;
829
                *wpix = SK_ColorTRANSPARENT;
830
        }
830
        }
831
    }
831
    }
832
}
832
}
833
 
833
 
834
/**
-
 
835
 * @brief backgroudFrame - Draws a solid underground for a border.
-
 
836
 * The method draw a pixel with color \b color at each point (pixel) where
-
 
837
 * the alpha value of the bitmap containing the border is not 0.
-
 
838
 *
-
 
839
 * @param bm        The bitmap containg the button image without the frame.
-
 
840
 * @param frame     The bitmap containg the frame.
-
 
841
 * @param color     The color to draw for each visible pixel in \b frame.
-
 
842
 */
-
 
843
void TIntBorder::backgroundFrame(SkBitmap* bm, SkBitmap& frame, SkColor color)
-
 
844
{
-
 
845
    DECL_TRACER("TIntBorder::backgroundFrame(SkBitmap* bm, SkBitmap& frame, SkColor color)");
-
 
846
 
-
 
847
    if (!bm || bm->empty() || frame.empty())
-
 
848
        return;
-
 
849
 
-
 
850
    int width = bm->info().width();
-
 
851
    int height = bm->info().height();
-
 
852
 
-
 
853
    if (width != frame.info().width() || height != frame.info().height())
-
 
854
    {
-
 
855
        MSG_WARNING("Size of bitmap and frame is different!");
-
 
856
        return;
-
 
857
    }
-
 
858
 
-
 
859
    for (int y = 0; y < height; ++y)
-
 
860
    {
-
 
861
        for (int x = 0; x < width; ++x)
-
 
862
        {
-
 
863
            SkColor *wpix = bm->getAddr32(x, y);
-
 
864
            SkColor fpix = frame.getColor(x, y);
-
 
865
 
-
 
866
            if (SkColorGetA(fpix) > 0)
-
 
867
                *wpix = color;
-
 
868
        }
-
 
869
    }
-
 
870
}
-
 
871
 
-
 
872
SkRect TIntBorder::calcRect(int width, int height, int pen)
834
SkRect TIntBorder::calcRect(int width, int height, int pen)
873
{
835
{
874
    DECL_TRACER("TIntBorder::calcRect(int width, int height, int pen)");
836
    DECL_TRACER("TIntBorder::calcRect(int width, int height, int pen)");
875
    SkRect rect;
837
    SkRect rect;
876
 
838