Chromium Code Reviews| Index: ui/gl/ca_renderer_layer_params.h |
| diff --git a/ui/gl/ca_renderer_layer_params.h b/ui/gl/ca_renderer_layer_params.h |
| index a6727b471384b5aadf25b21c6365a511e0ce67e5..78593e24934c8f64fba97234764ccd430126e49a 100644 |
| --- a/ui/gl/ca_renderer_layer_params.h |
| +++ b/ui/gl/ca_renderer_layer_params.h |
| @@ -5,6 +5,8 @@ |
| #ifndef UI_GL_CA_RENDERER_LAYER_PARAMS_H_ |
| #define UI_GL_CA_RENDERER_LAYER_PARAMS_H_ |
| +#include <vector> |
| + |
| #include "ui/gfx/geometry/rect.h" |
| #include "ui/gfx/geometry/rect_f.h" |
| #include "ui/gfx/transform.h" |
| @@ -42,6 +44,35 @@ struct GL_EXPORT CARendererLayerParams { |
| unsigned edge_aa_mask; |
| float opacity; |
| unsigned filter; |
| + |
| + // This is a subset of cc::FilterOperation::FilterType. |
| + enum class GL_EXPORT FilterEffectType { |
| + GRAYSCALE, |
| + SEPIA, |
| + SATURATE, |
| + HUE_ROTATE, |
| + INVERT, |
| + BRIGHTNESS, |
| + CONTRAST, |
| + OPACITY, |
| + BLUR, |
| + DROP_SHADOW, |
| + }; |
| + struct GL_EXPORT FilterEffect { |
| + FilterEffectType type = FilterEffectType::GRAYSCALE; |
| + |
| + // For every filter other than DROP_SHADOW, the field |data[0]| is a float |
| + // reinterpret casted to a int32_t. The rest of |data| is not used. |
| + // For DROP_SHADOW, the 4 fields represent: |
| + // data[0]: The blur amount, reinterpret casted from a float. |
| + // data[1]: x offset. |
| + // data[2]: y offset. |
| + // data[3]: SkColor, reinterpret casted from a uint32_t. |
| + int32_t data[4] = {0}; |
|
ccameron
2016/07/21 05:44:56
I'd think it better to do:
float amount = 0;
g
erikchen
2016/07/21 16:28:04
duh, good point. Done.
|
| + }; |
| + using FilterEffects = std::vector<FilterEffect>; |
| + |
| + FilterEffects filter_effects; |
| }; |
| } // namespace ui |