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

Unified Diff: cc/layer_tree_host_common.cc

Issue 11418197: Move temporary MathUtil wrappers to permanent home in gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
Index: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index 41d6875a9460456c0d1b3e9144558012a3965ed5..e147fe42d5f85819f3d503a0a1aa4ccf95508f3c 100644
--- a/cc/layer_tree_host_common.cc
+++ b/cc/layer_tree_host_common.cc
@@ -85,21 +85,21 @@ static bool isLayerBackFaceVisible(LayerType* layer)
// rendering context by checking if the parent preserves 3d.
if (layerIsInExisting3DRenderingContext(layer))
- return MathUtil::isBackFaceVisible(layer->drawTransform());
+ return layer->drawTransform().IsBackFaceVisible();
// In this case, either the layer establishes a new 3d rendering context, or is not in
// a 3d rendering context at all.
- return MathUtil::isBackFaceVisible(layer->transform());
+ return layer->transform().IsBackFaceVisible();
}
template<typename LayerType>
static bool isSurfaceBackFaceVisible(LayerType* layer, const gfx::Transform& drawTransform)
{
if (layerIsInExisting3DRenderingContext(layer))
- return MathUtil::isBackFaceVisible(drawTransform);
+ return drawTransform.IsBackFaceVisible();
if (isRootLayerOfNewRenderingContext(layer))
- return MathUtil::isBackFaceVisible(layer->transform());
+ return layer->transform().IsBackFaceVisible();
// If the renderSurface is not part of a new or existing rendering context, then the
// layers that contribute to this surface will decide back-face visibility for themselves.
@@ -140,14 +140,6 @@ static gfx::Rect calculateVisibleContentRect(LayerType* layer)
return LayerTreeHostCommon::calculateVisibleRect(targetSurfaceClipRect, gfx::Rect(gfx::Point(), layer->contentBounds()), layer->drawTransform());
}
-static bool isScaleOrTranslation(const gfx::Transform& m)
-{
- return !m.matrix().getDouble(1, 0) && !m.matrix().getDouble(2, 0) && !m.matrix().getDouble(3, 0)
- && !m.matrix().getDouble(0, 1) && !m.matrix().getDouble(2, 1) && !m.matrix().getDouble(3, 1)
- && !m.matrix().getDouble(0, 2) && !m.matrix().getDouble(1, 2) && !m.matrix().getDouble(2, 3)
- && m.matrix().getDouble(3, 3);
-}
-
static inline bool transformToParentIsKnown(LayerImpl*)
{
return true;
@@ -550,7 +542,7 @@ static void calculateDrawTransformsInternal(LayerType* layer, const gfx::Transfo
gfx::Vector2dF renderSurfaceSublayerScale = MathUtil::computeTransform2dScaleComponents(combinedTransform);
- if (subtreeShouldRenderToSeparateSurface(layer, isScaleOrTranslation(combinedTransform))) {
+ if (subtreeShouldRenderToSeparateSurface(layer, combinedTransform.IsScaleOrTranslation())) {
// Check back-face visibility before continuing with this surface and its subtree
if (!layer->doubleSided() && transformToParentIsKnown(layer) && isSurfaceBackFaceVisible(layer, combinedTransform))
return;

Powered by Google App Engine
This is Rietveld 408576698