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

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: patch for landing 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
« no previous file with comments | « cc/layer_sorter_unittest.cc ('k') | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common.cc
diff --git a/cc/layer_tree_host_common.cc b/cc/layer_tree_host_common.cc
index b6c4c4e76a990845c49052184c19f6b61ab2593b..0d6909cd9c0ae3b7ecd6734e1610ad3f08e23614 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;
@@ -562,7 +554,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;
« no previous file with comments | « cc/layer_sorter_unittest.cc ('k') | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698