blob: f5c7a6cfeadc7d13f30850f0e00b6bb2c8f3a792 [file] [log] [blame]
[email protected]d76806f82012-12-05 21:41:501// 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]cc3cfaa2013-03-18 09:05:525#ifndef CC_LAYERS_DRAW_PROPERTIES_H_
6#define CC_LAYERS_DRAW_PROPERTIES_H_
[email protected]d76806f82012-12-05 21:41:507
avi02a4d172015-12-21 06:14:368#include <stddef.h>
9
danakj60bc3bc2016-04-09 00:24:4810#include <memory>
11
danakj4902c302015-02-13 22:12:1612#include "cc/trees/occlusion.h"
heejin.r.chungd28506ba2014-10-23 16:36:2013#include "ui/gfx/geometry/rect.h"
[email protected]d76806f82012-12-05 21:41:5014#include "ui/gfx/transform.h"
15
16namespace cc {
17
18// Container for properties that layers need to compute before they can be
19// drawn.
[email protected]d76806f82012-12-05 21:41:5020struct CC_EXPORT DrawProperties {
ennefffb119c2015-08-29 09:17:3021 DrawProperties();
22 ~DrawProperties();
[email protected]d76806f82012-12-05 21:41:5023
[email protected]7af0d792013-03-24 09:38:5724 // Transforms objects from content space to target surface space, where
25 // this layer would be drawn.
26 gfx::Transform target_space_transform;
[email protected]d76806f82012-12-05 21:41:5027
[email protected]7af0d792013-03-24 09:38:5728 // Transforms objects from content space to screen space (viewport space).
29 gfx::Transform screen_space_transform;
[email protected]d76806f82012-12-05 21:41:5030
danakj4902c302015-02-13 22:12:1631 // Known occlusion above the layer mapped to the content space of the layer.
32 Occlusion occlusion_in_content_space;
33
ennefffb119c2015-08-29 09:17:3034 // DrawProperties::opacity may be different than LayerImpl::opacity,
[email protected]ed511b8d2013-03-25 03:29:2935 // particularly in the case when a RenderSurface re-parents the layer's
[email protected]7af0d792013-03-24 09:38:5736 // opacity, or when opacity is compounded by the hierarchy.
37 float opacity;
[email protected]d76806f82012-12-05 21:41:5038
wkormane1e616d2017-04-06 20:52:5139 // 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]7af0d792013-03-24 09:38:5742 bool screen_space_transform_is_animating;
[email protected]d76806f82012-12-05 21:41:5043
ajumae2b7a5c2015-09-30 21:41:4244 // True if the layer needs to be clipped by clip_rect.
45 bool is_clipped;
46
danakj64767d902015-06-19 00:10:4347 // 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]d76806f82012-12-05 21:41:5050
[email protected]7af0d792013-03-24 09:38:5751 // In target surface space, the rect that encloses the clipped, drawable
52 // content of the layer.
53 gfx::Rect drawable_content_rect;
[email protected]d76806f82012-12-05 21:41:5054
[email protected]7af0d792013-03-24 09:38:5755 // 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]d76806f82012-12-05 21:41:5058};
59
60} // namespace cc
61
[email protected]cc3cfaa2013-03-18 09:05:5262#endif // CC_LAYERS_DRAW_PROPERTIES_H_