diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-29 21:51:45 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-29 21:51:45 +0000 |
commit | 6ba000db056d7e9b70a7e154a003644046bf7e98 (patch) | |
tree | 30c43ec8543ec9cb66169721e3268ea0a7cdb76f /src/select/propget.h | |
parent | 1b13f81b8259f4416df7b3063cb280cb977722d7 (diff) | |
download | libcss-6ba000db056d7e9b70a7e154a003644046bf7e98.tar.gz libcss-6ba000db056d7e9b70a7e154a003644046bf7e98.tar.bz2 |
Add support for opacity property
svn path=/trunk/libcss/; revision=11527
Diffstat (limited to 'src/select/propget.h')
-rw-r--r-- | src/select/propget.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h index bf59e87..40aa51a 100644 --- a/src/select/propget.h +++ b/src/select/propget.h @@ -1310,6 +1310,28 @@ static inline uint8_t get_position( #undef POSITION_SHIFT #undef POSITION_INDEX +#define OPACITY_INDEX 23 +#define OPACITY_SHIFT 2 +#define OPACITY_MASK 0x04 +static inline uint8_t get_opacity( + const css_computed_style *style, + css_fixed *opacity) +{ + uint8_t bits = style->bits[OPACITY_INDEX]; + bits &= OPACITY_MASK; + bits >>= OPACITY_SHIFT; + + /* 1bit: t : type */ + if ((bits & 0x1) == CSS_OPACITY_SET) { + *opacity = style->opacity; + } + + return (bits & 0x1); +} +#undef OPACITY_MASK +#undef OPACITY_SHIFT +#undef OPACITY_INDEX + #define TEXT_TRANSFORM_INDEX 24 #define TEXT_TRANSFORM_SHIFT 0 #define TEXT_TRANSFORM_MASK 0x7 |