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

Unified Diff: cc/layer_tree_host_common_unittest.cc

Issue 12541006: Use LCD text if the transform IsAlmostIdentityAndIntegerTranslation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: How about this? (not finished yet) Created 7 years, 9 months 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
« cc/layer_tree_host_common.cc ('K') | « cc/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common_unittest.cc
diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
index 926ae2ba364041be4a0fcdcdba8f01328d4e20b2..fbd1fc2013fb3dd8d5744f26efa406c779d6478d 100644
--- a/cc/layer_tree_host_common_unittest.cc
+++ b/cc/layer_tree_host_common_unittest.cc
@@ -5147,5 +5147,34 @@ INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest,
testing::Combine(testing::Bool(),
testing::Bool()));
+TEST(LayerTreeHostCommonTest, verifyRoundAlmostIntegerComponentsInTransforms)
+{
+ const float kPageScale = 0.9f;
+ const float kDeviceScale = 1.234567f;
+
+ FakeImplProxy proxy;
+ FakeLayerTreeHostImpl hostImpl(&proxy);
+
+ gfx::Transform implTransform;
+ implTransform.Scale(kPageScale, kPageScale);
+
+ gfx::Transform identityMatrix;
+ scoped_ptr<LayerImpl> layerScopedPtr = LayerImpl::create(hostImpl.activeTree(), 1);
+ LayerImpl* layer = layerScopedPtr.get();
+ layer->setContentsScale(kPageScale * kDeviceScale, kPageScale * kDeviceScale);
+ setLayerPropertiesForTesting(layer, identityMatrix, identityMatrix, gfx::Point(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
+
+ scoped_ptr<LayerImpl> root = LayerImpl::create(hostImpl.activeTree(), 2);
+ root->setContentsScale(kPageScale * kDeviceScale, kPageScale * kDeviceScale);
+ root->setImplTransform(implTransform);
+ root->addChild(layerScopedPtr.Pass());
+
+ executeCalculateDrawProperties(root.get(), kDeviceScale, kPageScale, true);
+ EXPECT_TRUE(layer->drawTransform().IsIdentity());
+ EXPECT_TRUE(layer->canUseLCDText());
+ EXPECT_TRUE(root->drawTransform().IsIdentity());
+ EXPECT_TRUE(root->canUseLCDText());
+}
+
} // namespace
} // namespace cc
« cc/layer_tree_host_common.cc ('K') | « cc/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698