diff options
author | nyamatongwe <devnull@localhost> | 2011-06-18 11:56:55 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-06-18 11:56:55 +1000 |
commit | 31d40085adf9a952d254de47113fe7c0d34c49d1 (patch) | |
tree | bc564c05e79566341ea50df27dd538cce39cba7e | |
parent | be0f88393d907476e720a82493c80f7bf5df04b7 (diff) | |
download | scintilla-mirror-31d40085adf9a952d254de47113fe7c0d34c49d1.tar.gz |
Updating AlphaRectangle for Cairo mode with no palette.
-rw-r--r-- | gtk/PlatGTK.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 483ed06b0..bf4dbbe40 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1250,8 +1250,6 @@ static guint32 u32FromRGBA(guint8 r, guint8 g, guint8 b, guint8 a) { return converter.val; } -#endif - static unsigned int GetRValue(unsigned int co) { return (co >> 16) & 0xff; } @@ -1264,22 +1262,26 @@ static unsigned int GetBValue(unsigned int co) { return co & 0xff; } +#endif + void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int flags) { #ifdef USE_CAIRO if (context && rc.Width() > 0) { + ColourDesired cdFill(fill.AsLong()); cairo_set_source_rgba(context, - GetRValue(fill.AsLong()) / 255.0, - GetGValue(fill.AsLong()) / 255.0, - GetBValue(fill.AsLong()) / 255.0, + cdFill.GetRed() / 255.0, + cdFill.GetGreen() / 255.0, + cdFill.GetBlue() / 255.0, alphaFill / 255.0); PathRoundRectangle(context, rc.left + 1.0, rc.top+1.0, rc.right - rc.left - 2.0, rc.bottom - rc.top - 2.0, cornerSize); cairo_fill(context); + ColourDesired cdOutline(outline.AsLong()); cairo_set_source_rgba(context, - GetRValue(outline.AsLong()) / 255.0, - GetGValue(outline.AsLong()) / 255.0, - GetBValue(outline.AsLong()) / 255.0, + cdOutline.GetRed() / 255.0, + cdOutline.GetGreen() / 255.0, + cdOutline.GetBlue() / 255.0, alphaOutline / 255.0); PathRoundRectangle(context, rc.left +0.5, rc.top+0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1, cornerSize); cairo_stroke(context); |