blob: 933bf02fcac50d0e301b65235aeab505500cdd14 [file] [log] [blame]
jbauman80ceeee2017-03-13 22:43:571// 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
jbauman78f5d7d2017-03-29 21:47:3610#include "base/memory/ref_counted.h"
jbauman80ceeee2017-03-13 22:43:5711#include "third_party/skia/include/core/SkColor.h"
12#include "ui/gfx/geometry/point.h"
13#include "ui/gfx/geometry/rect.h"
14#include "ui/gfx/geometry/rect_f.h"
15#include "ui/gfx/transform.h"
16#include "ui/gl/gl_export.h"
17
18namespace gl {
19class GLImage;
20}
21
22namespace ui {
23
24struct GL_EXPORT DCRendererLayerParams {
25 DCRendererLayerParams(bool is_clipped,
26 const gfx::Rect clip_rect,
jbauman78f5d7d2017-03-29 21:47:3627 int z_order,
jbauman80ceeee2017-03-13 22:43:5728 const gfx::Transform& transform,
jbaumand817ddec2017-05-04 21:05:0529 std::vector<scoped_refptr<gl::GLImage>> image,
jbauman80ceeee2017-03-13 22:43:5730 const gfx::RectF& contents_rect,
31 const gfx::Rect& rect,
32 unsigned background_color,
33 unsigned edge_aa_mask,
34 float opacity,
35 unsigned filter);
36 DCRendererLayerParams(const DCRendererLayerParams& other);
37 ~DCRendererLayerParams();
38
39 bool is_clipped;
40 const gfx::Rect clip_rect;
jbauman78f5d7d2017-03-29 21:47:3641 int z_order;
jbauman80ceeee2017-03-13 22:43:5742 const gfx::Transform transform;
jbaumand817ddec2017-05-04 21:05:0543 std::vector<scoped_refptr<gl::GLImage>> image;
jbauman80ceeee2017-03-13 22:43:5744 const gfx::RectF contents_rect;
45 const gfx::Rect rect;
46 unsigned background_color;
47 unsigned edge_aa_mask;
48 float opacity;
49 unsigned filter;
50
51 // This is a subset of cc::FilterOperation::FilterType.
52 enum class FilterEffectType : uint32_t {
53 GRAYSDCLE,
54 SEPIA,
55 SATURATE,
56 HUE_ROTATE,
57 INVERT,
58 BRIGHTNESS,
59 CONTRAST,
60 OPACITY,
61 BLUR,
62 DROP_SHADOW,
63 };
64 struct GL_EXPORT FilterEffect {
65 FilterEffectType type = FilterEffectType::GRAYSDCLE;
66
67 // For every filter other than DROP_SHADOW, only |amount| is populated.
68 float amount = 0;
69 gfx::Point drop_shadow_offset;
70 SkColor drop_shadow_color = 0;
71 };
72 using FilterEffects = std::vector<FilterEffect>;
73
74 FilterEffects filter_effects;
75};
76
77} // namespace ui
78
79#endif // UI_GL_DC_RENDERER_LAYER_PARAMS_H_