diff options
author | John Stultz <john.stultz@linaro.org> | 2011-04-18 13:19:07 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2011-04-18 13:19:07 -0700 |
commit | 775d71e49c65f1f6aa57776ea1da62988fc9a30a (patch) | |
tree | ce03cae544bacc8dda67422fd66a543dd1ae3c99 /drivers/video/fb_draw.h | |
parent | 18e82d2b952ab57fc1c8a69d4fa14e562f2aecf6 (diff) | |
parent | c1a952f48517b5545075d8eb1a5d543099bd2ae1 (diff) |
Merge branch 'upstream/linaro.38' into linaro-android.38KNOWN_GOOD
Diffstat (limited to 'drivers/video/fb_draw.h')
-rw-r--r-- | drivers/video/fb_draw.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h index 04c01faaf77..4ba0e0b1f16 100644 --- a/drivers/video/fb_draw.h +++ b/drivers/video/fb_draw.h @@ -15,6 +15,20 @@ comp(unsigned long a, unsigned long b, unsigned long mask) return ((a ^ b) & mask) ^ b; } +/* if framebuffer has alpha channel, mask in the appropriate + * bit(s) to make the specified color opaque + */ +static inline unsigned long +solid_color(struct fb_info *p, unsigned long color) +{ + if (p->var.transp.length > 0) { + u32 mask = (1 << p->var.transp.length) - 1; + mask <<= p->var.transp.offset; + color |= mask; + } + return color; +} + /* * Create a pattern with the given pixel's color */ |