Commit f2f7de31 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove unused printing unit conversion functions.

Change-Id: I4a325218a3db80731e1a110e1beab38ecc071530
Reviewed-on: https://chromium-review.googlesource.com/1111678Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569764}
parent dcdd42dd
...@@ -28,18 +28,6 @@ double ConvertUnitDouble(double value, double old_unit, double new_unit) { ...@@ -28,18 +28,6 @@ double ConvertUnitDouble(double value, double old_unit, double new_unit) {
return value * new_unit / old_unit; return value * new_unit / old_unit;
} }
int ConvertMilliInchToHundredThousanthMeter(int milli_inch) {
// 1" == 25.4 mm
// 1" == 25400 um
// 0.001" == 25.4 um
// 0.001" == 2.54 cmm
return ConvertUnit(milli_inch, 100, 254);
}
int ConvertHundredThousanthMeterToMilliInch(int cmm) {
return ConvertUnit(cmm, 254, 100);
}
int ConvertPixelsToPoint(int pixels) { int ConvertPixelsToPoint(int pixels) {
return ConvertUnit(pixels, kPixelsPerInch, kPointsPerInch); return ConvertUnit(pixels, kPixelsPerInch, kPointsPerInch);
} }
......
...@@ -50,12 +50,6 @@ PRINTING_EXPORT int ConvertUnit(double value, int old_unit, int new_unit); ...@@ -50,12 +50,6 @@ PRINTING_EXPORT int ConvertUnit(double value, int old_unit, int new_unit);
PRINTING_EXPORT double ConvertUnitDouble(double value, double old_unit, PRINTING_EXPORT double ConvertUnitDouble(double value, double old_unit,
double new_unit); double new_unit);
// Converts from 0.001 inch unit to 0.00001 meter.
PRINTING_EXPORT int ConvertMilliInchToHundredThousanthMeter(int milli_inch);
// Converts from 0.00001 meter unit to 0.001 inch.
PRINTING_EXPORT int ConvertHundredThousanthMeterToMilliInch(int cmm);
// Converts from 1 pixel to 1 point using integers. // Converts from 1 pixel to 1 point using integers.
PRINTING_EXPORT int ConvertPixelsToPoint(int pixels); PRINTING_EXPORT int ConvertPixelsToPoint(int pixels);
......
...@@ -51,15 +51,6 @@ TEST(UnitsTest, Convertions) { ...@@ -51,15 +51,6 @@ TEST(UnitsTest, Convertions) {
EXPECT_DOUBLE_EQ(0.000002, ConvertUnitDouble(2, 1000, 0.001)); EXPECT_DOUBLE_EQ(0.000002, ConvertUnitDouble(2, 1000, 0.001));
EXPECT_EQ(2000000, ConvertUnitDouble(2, 0.001, 1000)); EXPECT_EQ(2000000, ConvertUnitDouble(2, 0.001, 1000));
EXPECT_EQ(kHundrethsMMPerInch, ConvertMilliInchToHundredThousanthMeter(1000));
EXPECT_EQ(-kHundrethsMMPerInch,
ConvertMilliInchToHundredThousanthMeter(-1000));
EXPECT_EQ(0, ConvertMilliInchToHundredThousanthMeter(0));
EXPECT_EQ(1000, ConvertHundredThousanthMeterToMilliInch(kHundrethsMMPerInch));
EXPECT_EQ(-1000,
ConvertHundredThousanthMeterToMilliInch(-kHundrethsMMPerInch));
EXPECT_EQ(0, ConvertHundredThousanthMeterToMilliInch(0));
EXPECT_EQ(8.25, ConvertPixelsToPointDouble(11.0)); EXPECT_EQ(8.25, ConvertPixelsToPointDouble(11.0));
// Round down. // Round down.
EXPECT_EQ(8, ConvertPixelsToPoint(11)); EXPECT_EQ(8, ConvertPixelsToPoint(11));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment