[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 1 | // Copyright 2012 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 | |||||
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 5 | #ifndef CC_LAYERS_DRAW_PROPERTIES_H_ |
6 | #define CC_LAYERS_DRAW_PROPERTIES_H_ | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 7 | |
avi | 02a4d17 | 2015-12-21 06:14:36 | [diff] [blame] | 8 | #include <stddef.h> |
9 | |||||
danakj | 60bc3bc | 2016-04-09 00:24:48 | [diff] [blame] | 10 | #include <memory> |
11 | |||||
danakj | 4902c30 | 2015-02-13 22:12:16 | [diff] [blame] | 12 | #include "cc/trees/occlusion.h" |
heejin.r.chung | d28506ba | 2014-10-23 16:36:20 | [diff] [blame] | 13 | #include "ui/gfx/geometry/rect.h" |
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 14 | #include "ui/gfx/transform.h" |
15 | |||||
16 | namespace cc { | ||||
17 | |||||
18 | // Container for properties that layers need to compute before they can be | ||||
19 | // drawn. | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 20 | struct CC_EXPORT DrawProperties { |
enne | fffb119c | 2015-08-29 09:17:30 | [diff] [blame] | 21 | DrawProperties(); |
22 | ~DrawProperties(); | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 23 | |
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 24 | // Transforms objects from content space to target surface space, where |
25 | // this layer would be drawn. | ||||
26 | gfx::Transform target_space_transform; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 27 | |
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 28 | // Transforms objects from content space to screen space (viewport space). |
29 | gfx::Transform screen_space_transform; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 30 | |
danakj | 4902c30 | 2015-02-13 22:12:16 | [diff] [blame] | 31 | // Known occlusion above the layer mapped to the content space of the layer. |
32 | Occlusion occlusion_in_content_space; | ||||
33 | |||||
enne | fffb119c | 2015-08-29 09:17:30 | [diff] [blame] | 34 | // DrawProperties::opacity may be different than LayerImpl::opacity, |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 35 | // particularly in the case when a RenderSurface re-parents the layer's |
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 36 | // opacity, or when opacity is compounded by the hierarchy. |
37 | float opacity; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 38 | |
wkorman | e1e616d | 2017-04-06 20:52:51 | [diff] [blame^] | 39 | // Whether the layer has a potentially animating transform in its chain of |
40 | // transforms to the screen. This is essentially a cache of the transform | ||||
41 | // node's potentially-animated status. | ||||
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 42 | bool screen_space_transform_is_animating; |
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 43 | |
ajuma | e2b7a5c | 2015-09-30 21:41:42 | [diff] [blame] | 44 | // True if the layer needs to be clipped by clip_rect. |
45 | bool is_clipped; | ||||
46 | |||||
danakj | 64767d90 | 2015-06-19 00:10:43 | [diff] [blame] | 47 | // This rect is a bounding box around what part of the layer is visible, in |
48 | // the layer's coordinate space. | ||||
49 | gfx::Rect visible_layer_rect; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 50 | |
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 51 | // In target surface space, the rect that encloses the clipped, drawable |
52 | // content of the layer. | ||||
53 | gfx::Rect drawable_content_rect; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 54 | |
[email protected] | 7af0d79 | 2013-03-24 09:38:57 | [diff] [blame] | 55 | // In target surface space, the original rect that clipped this layer. This |
56 | // value is used to avoid unnecessarily changing GL scissor state. | ||||
57 | gfx::Rect clip_rect; | ||||
[email protected] | d76806f8 | 2012-12-05 21:41:50 | [diff] [blame] | 58 | }; |
59 | |||||
60 | } // namespace cc | ||||
61 | |||||
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 62 | #endif // CC_LAYERS_DRAW_PROPERTIES_H_ |