OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_GL_DC_RENDERER_LAYER_PARAMS_H_ |
| 6 #define UI_GL_DC_RENDERER_LAYER_PARAMS_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/gfx/geometry/point.h" |
| 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/rect_f.h" |
| 14 #include "ui/gfx/transform.h" |
| 15 #include "ui/gl/gl_export.h" |
| 16 |
| 17 namespace gl { |
| 18 class GLImage; |
| 19 } |
| 20 |
| 21 namespace ui { |
| 22 |
| 23 struct GL_EXPORT DCRendererLayerParams { |
| 24 DCRendererLayerParams(bool is_clipped, |
| 25 const gfx::Rect clip_rect, |
| 26 unsigned sorting_context_id, |
| 27 const gfx::Transform& transform, |
| 28 gl::GLImage* image, |
| 29 const gfx::RectF& contents_rect, |
| 30 const gfx::Rect& rect, |
| 31 unsigned background_color, |
| 32 unsigned edge_aa_mask, |
| 33 float opacity, |
| 34 unsigned filter); |
| 35 DCRendererLayerParams(const DCRendererLayerParams& other); |
| 36 ~DCRendererLayerParams(); |
| 37 |
| 38 bool is_clipped; |
| 39 const gfx::Rect clip_rect; |
| 40 unsigned sorting_context_id; |
| 41 const gfx::Transform transform; |
| 42 gl::GLImage* image; |
| 43 const gfx::RectF contents_rect; |
| 44 const gfx::Rect rect; |
| 45 unsigned background_color; |
| 46 unsigned edge_aa_mask; |
| 47 float opacity; |
| 48 unsigned filter; |
| 49 |
| 50 // This is a subset of cc::FilterOperation::FilterType. |
| 51 enum class FilterEffectType : uint32_t { |
| 52 GRAYSDCLE, |
| 53 SEPIA, |
| 54 SATURATE, |
| 55 HUE_ROTATE, |
| 56 INVERT, |
| 57 BRIGHTNESS, |
| 58 CONTRAST, |
| 59 OPACITY, |
| 60 BLUR, |
| 61 DROP_SHADOW, |
| 62 }; |
| 63 struct GL_EXPORT FilterEffect { |
| 64 FilterEffectType type = FilterEffectType::GRAYSDCLE; |
| 65 |
| 66 // For every filter other than DROP_SHADOW, only |amount| is populated. |
| 67 float amount = 0; |
| 68 gfx::Point drop_shadow_offset; |
| 69 SkColor drop_shadow_color = 0; |
| 70 }; |
| 71 using FilterEffects = std::vector<FilterEffect>; |
| 72 |
| 73 FilterEffects filter_effects; |
| 74 }; |
| 75 |
| 76 } // namespace ui |
| 77 |
| 78 #endif // UI_GL_DC_RENDERER_LAYER_PARAMS_H_ |
OLD | NEW |