Chromium Code Reviews| Index: cc/draw_properties.h |
| diff --git a/cc/draw_properties.h b/cc/draw_properties.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..201d93cea607e20c5e6378f7db00746555cf6e97 |
| --- /dev/null |
| +++ b/cc/draw_properties.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright 2011 The Chromium Authors. All rights reserved. |
|
danakj
2012/12/03 18:54:36
2012.
Use chromium style names/indents for new fi
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_DRAW_PROPERTIES_H_ |
| +#define CC_DRAW_PROPERTIES_H_ |
| + |
| +#include "ui/gfx/rect.h" |
| +#include "ui/gfx/transform.h" |
| + |
| +namespace cc { |
| + |
| +// Container for properties that layers need to compute before they can be |
| +// drawn. |
| +template<typename LayerType> |
| +struct DrawProperties { |
| + DrawProperties() |
| + : drawOpacity(0) |
| + , drawOpacityIsAnimating(false) |
| + , drawTransformIsAnimating(false) |
| + , screenSpaceTransformIsAnimating(false) |
| + , isClipped(false) |
| + , renderTarget(0) |
| + { |
| + } |
| + |
| + // Transforms objects from content space to target surface space, where |
| + // this layer would be drawn. |
| + gfx::Transform drawTransform; |
|
jamesr
2012/12/04 06:44:32
drawProperties().drawTransform is a bit redundant.
|
| + |
| + // Transforms objects from content space to screen space (viewport space). |
| + gfx::Transform screenSpaceTransform; |
| + |
| + // drawOpacity may be different than layer's opacity, particularly in the |
| + // case where a renderSurface re-parents the layer's opacity. |
| + float drawOpacity; |
|
jamesr
2012/12/04 06:44:32
same here - drawProperties().opacity ?
|
| + |
| + // XXXIsAnimating flags are used to indicate whether the drawProperties |
| + // are actually meaningful on the main thread. When the properties are |
| + // animating, the main thread may not have the same values that are used |
| + // to draw. |
| + bool drawOpacityIsAnimating; |
| + bool drawTransformIsAnimating; |
|
jamesr
2012/12/04 06:44:32
more possibly unnecessary draw prefixes
|
| + bool screenSpaceTransformIsAnimating; |
| + |
| + // True if the layer needs to be clipped by clipRect. |
| + bool isClipped; |
| + |
| + // The layer whose coordinate space this layer draws into. This can be |
| + // either the same layer (m_drawProperties.renderTarget == this) or an |
| + // ancestor of this layer. |
| + LayerType* renderTarget; |
| + |
| + // Uses layer's content space. |
| + gfx::Rect visibleContentRect; |
| + |
| + // In target surface space, the rect that encloses the clipped, drawable |
| + // content of the layer. |
| + gfx::Rect drawableContentRect; |
| + |
| + // In target surface space, the original rect that clipped this |
| + // layer. This value is used to avoid unnecessarily changing GL scissor |
| + // state. |
| + gfx::Rect clipRect; |
| +}; |
| + |
| +} |
|
danakj
2012/12/03 18:54:36
} // namespace cc
|
| + |
| +#endif // CC_DRAW_PROPERTIES_H_ |