Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: cc/draw_properties.h

Issue 11280263: Organize internal properties of cc/ layer types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Complete patch Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/cc.gyp ('k') | cc/layer.h » ('j') | cc/layer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « cc/cc.gyp ('k') | cc/layer.h » ('j') | cc/layer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698