OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
10 #include "ash/display/display_layout_store.h" | 10 #include "ash/display/display_layout_store.h" |
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1519 // test::AshTestBase: | 1519 // test::AshTestBase: |
1520 void TestBody() override { NOTREACHED(); } | 1520 void TestBody() override { NOTREACHED(); } |
1521 | 1521 |
1522 private: | 1522 private: |
1523 DISALLOW_COPY_AND_ASSIGN(FontTestHelper); | 1523 DISALLOW_COPY_AND_ASSIGN(FontTestHelper); |
1524 }; | 1524 }; |
1525 | 1525 |
1526 | 1526 |
1527 bool IsTextSubpixelPositioningEnabled() { | 1527 bool IsTextSubpixelPositioningEnabled() { |
1528 gfx::FontRenderParams params = | 1528 gfx::FontRenderParams params = |
1529 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); | 1529 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL); |
1530 return params.subpixel_positioning; | 1530 return params.subpixel_positioning; |
1531 } | 1531 } |
1532 | 1532 |
1533 gfx::FontRenderParams::Hinting GetFontHintingParams() { | 1533 gfx::FontRenderParams::Hinting GetFontHintingParams() { |
1534 gfx::FontRenderParams params = | 1534 gfx::FontRenderParams params = |
1535 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); | 1535 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL); |
1536 return params.hinting; | 1536 return params.hinting; |
1537 } | 1537 } |
1538 | 1538 |
1539 } // namespace | 1539 } // namespace |
1540 | 1540 |
1541 typedef testing::Test DisplayManagerFontTest; | 1541 typedef testing::Test DisplayManagerFontTest; |
1542 | 1542 |
1543 TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100Internal) { | 1543 TEST_F(DisplayManagerFontTest, TextSubpixelPositioningWithDsf100Internal) { |
1544 FontTestHelper helper(1.0f, FontTestHelper::INTERNAL); | 1544 FontTestHelper helper(1.0f, FontTestHelper::INTERNAL); |
1545 ASSERT_DOUBLE_EQ( | 1545 ASSERT_DOUBLE_EQ( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 1.25f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); | 1612 1.25f, Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
1613 EXPECT_TRUE(IsTextSubpixelPositioningEnabled()); | 1613 EXPECT_TRUE(IsTextSubpixelPositioningEnabled()); |
1614 EXPECT_EQ(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); | 1614 EXPECT_EQ(gfx::FontRenderParams::HINTING_NONE, GetFontHintingParams()); |
1615 | 1615 |
1616 DisplayInfo::SetUse125DSFForUIScaling(false); | 1616 DisplayInfo::SetUse125DSFForUIScaling(false); |
1617 } | 1617 } |
1618 | 1618 |
1619 #endif // OS_CHROMEOS | 1619 #endif // OS_CHROMEOS |
1620 | 1620 |
1621 } // namespace ash | 1621 } // namespace ash |
OLD | NEW |