Commit 749dbc02 authored by Hui Yingst's avatar Hui Yingst Committed by Chromium LUCI CQ

Remove uses of VectorFromPPPoint() and PPPointFromVector().

This CL removes uses of VectorFromPPPoint() since it no longer has a
caller, and replaces PPPointFromVector() with a pp::Point constructor.

Change-Id: I773be154d1eb844325832ff1248147a890c36f73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2604953
Commit-Queue: Hui Yingst <nigi@chromium.org>
Reviewed-by: default avatarK. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840752}
parent 5553ab08
...@@ -55,12 +55,4 @@ PP_Size PPSizeFromSize(const gfx::Size& size) { ...@@ -55,12 +55,4 @@ PP_Size PPSizeFromSize(const gfx::Size& size) {
return PP_MakeSize(size.width(), size.height()); return PP_MakeSize(size.width(), size.height());
} }
gfx::Vector2d VectorFromPPPoint(const PP_Point& pp_point) {
return gfx::Vector2d(pp_point.x, pp_point.y);
}
PP_Point PPPointFromVector(const gfx::Vector2d& vector) {
return PP_MakePoint(vector.x(), vector.y());
}
} // namespace chrome_pdf } // namespace chrome_pdf
...@@ -17,7 +17,6 @@ class PointF; ...@@ -17,7 +17,6 @@ class PointF;
class Rect; class Rect;
class RectF; class RectF;
class Size; class Size;
class Vector2d;
} // namespace gfx } // namespace gfx
namespace chrome_pdf { namespace chrome_pdf {
...@@ -36,9 +35,6 @@ PP_FloatRect PPFloatRectFromRectF(const gfx::RectF& rect); ...@@ -36,9 +35,6 @@ PP_FloatRect PPFloatRectFromRectF(const gfx::RectF& rect);
gfx::Size SizeFromPPSize(const PP_Size& pp_size); gfx::Size SizeFromPPSize(const PP_Size& pp_size);
PP_Size PPSizeFromSize(const gfx::Size& size); PP_Size PPSizeFromSize(const gfx::Size& size);
gfx::Vector2d VectorFromPPPoint(const PP_Point& pp_point);
PP_Point PPPointFromVector(const gfx::Vector2d& vector);
} // namespace chrome_pdf } // namespace chrome_pdf
#endif // PDF_PPAPI_MIGRATION_GEOMETRY_CONVERSIONS_H_ #endif // PDF_PPAPI_MIGRATION_GEOMETRY_CONVERSIONS_H_
...@@ -112,22 +112,4 @@ TEST(GeometryConversionsTest, PPSizeFromSize) { ...@@ -112,22 +112,4 @@ TEST(GeometryConversionsTest, PPSizeFromSize) {
EXPECT_EQ(pp_c_size.height, 3); EXPECT_EQ(pp_c_size.height, 3);
} }
TEST(GeometryConversionsTest, VectorFromPPPoint) {
gfx::Vector2d point = VectorFromPPPoint(pp::Point(-1, 2));
EXPECT_EQ(point, gfx::Vector2d(-1, 2));
point = VectorFromPPPoint(PP_MakePoint(2, -1));
EXPECT_EQ(point, gfx::Vector2d(2, -1));
}
TEST(GeometryConversionsTest, PPPointFromVector) {
pp::Point pp_cpp_point = PPPointFromVector(gfx::Vector2d(-1, 2));
EXPECT_EQ(pp_cpp_point.x(), -1);
EXPECT_EQ(pp_cpp_point.y(), 2);
PP_Point pp_c_point = PPPointFromVector(gfx::Vector2d(2, -1));
EXPECT_EQ(pp_c_point.x, 2);
EXPECT_EQ(pp_c_point.y, -1);
}
} // namespace chrome_pdf } // namespace chrome_pdf
...@@ -62,7 +62,8 @@ void PepperGraphics::PaintImage(const Image& image, const gfx::Rect& src_rect) { ...@@ -62,7 +62,8 @@ void PepperGraphics::PaintImage(const Image& image, const gfx::Rect& src_rect) {
void PepperGraphics::Scroll(const gfx::Rect& clip, void PepperGraphics::Scroll(const gfx::Rect& clip,
const gfx::Vector2d& amount) { const gfx::Vector2d& amount) {
pepper_graphics_.Scroll(PPRectFromRect(clip), PPPointFromVector(amount)); pepper_graphics_.Scroll(PPRectFromRect(clip),
pp::Point(amount.x(), amount.y()));
} }
void PepperGraphics::SetScale(float scale) { void PepperGraphics::SetScale(float scale) {
...@@ -74,7 +75,7 @@ void PepperGraphics::SetLayerTransform(float scale, ...@@ -74,7 +75,7 @@ void PepperGraphics::SetLayerTransform(float scale,
const gfx::Point& origin, const gfx::Point& origin,
const gfx::Vector2d& translate) { const gfx::Vector2d& translate) {
bool result = pepper_graphics_.SetLayerTransform( bool result = pepper_graphics_.SetLayerTransform(
scale, PPPointFromPoint(origin), PPPointFromVector(translate)); scale, PPPointFromPoint(origin), pp::Point(translate.x(), translate.y()));
DCHECK(result); DCHECK(result);
} }
......
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