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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 2616963002: Remove unused Canvas::DrawStringRectWithShadows(). (Closed)
Patch Set: more iwyu Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_item_cell.mm ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 8f674a6916c2f439962b3c071ae41cfcf6065cf5..9150bf55b9216013fb32ccb81e726127801c3e4c 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -98,7 +98,6 @@ class DrawStringLayerDelegate : public LayerDelegate {
enum DrawFunction {
STRING_WITH_HALO,
STRING_FADED,
- STRING_WITH_SHADOWS
};
DrawStringLayerDelegate(
@@ -127,14 +126,6 @@ class DrawStringLayerDelegate : public LayerDelegate {
recorder.canvas()->DrawFadedString(
text, font_list_, SK_ColorRED, bounds, 0);
break;
- case STRING_WITH_SHADOWS: {
- gfx::ShadowValues shadows;
- shadows.push_back(
- gfx::ShadowValue(gfx::Vector2d(2, 2), 2, SK_ColorRED));
- recorder.canvas()->DrawStringRectWithShadows(
- text, font_list_, SK_ColorRED, bounds, 0, 0, shadows);
- break;
- }
default:
NOTREACHED();
}
@@ -1526,41 +1517,6 @@ TEST_F(LayerWithRealCompositorTest, CanvasDrawFadedString) {
large_error_allowed,
small_error_allowed)));
}
-
-TEST_F(LayerWithRealCompositorTest, CanvasDrawStringRectWithShadows) {
- gfx::Size size(50, 50);
- GetCompositor()->SetScaleAndSize(1.0f, size);
- DrawStringLayerDelegate delegate(
- SK_ColorBLUE, SK_ColorWHITE,
- DrawStringLayerDelegate::STRING_WITH_SHADOWS,
- size);
- std::unique_ptr<Layer> layer(
- CreateDrawStringLayer(gfx::Rect(size), &delegate));
- DrawTree(layer.get());
-
- SkBitmap bitmap;
- ReadPixels(&bitmap);
- ASSERT_FALSE(bitmap.empty());
-
- base::FilePath ref_img =
- test_data_directory().AppendASCII("string_with_shadows.png");
- // WritePNGFile(bitmap, ref_img, true);
-
- float percentage_pixels_large_error = 7.4f; // 185px / (50*50)
- float percentage_pixels_small_error = 0.0f;
- float average_error_allowed_in_bad_pixels = 60.f;
- int large_error_allowed = 246;
- int small_error_allowed = 0;
-
- EXPECT_TRUE(MatchesPNGFile(bitmap, ref_img,
- cc::FuzzyPixelComparator(
- true,
- percentage_pixels_large_error,
- percentage_pixels_small_error,
- average_error_allowed_in_bad_pixels,
- large_error_allowed,
- small_error_allowed)));
-}
#endif // defined(OS_WIN)
// Opacity is rendered correctly.
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_item_cell.mm ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698