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

Unified Diff: Source/core/rendering/shapes/Shape.cpp

Issue 381473006: Clean up static_cast<const toBasicFoo*> by using toBasicFoo() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | Source/core/rendering/style/BasicShapes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/Shape.cpp
diff --git a/Source/core/rendering/shapes/Shape.cpp b/Source/core/rendering/shapes/Shape.cpp
index 1a0fae619740533b20ef2f9ccd28dd48870d05eb..7054a6ed851f66c0cec94ed2ad2509aabd91e4e3 100644
--- a/Source/core/rendering/shapes/Shape.cpp
+++ b/Source/core/rendering/shapes/Shape.cpp
@@ -107,7 +107,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
switch (basicShape->type()) {
case BasicShape::BasicShapeCircleType: {
- const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape);
+ const BasicShapeCircle* circle = toBasicShapeCircle(basicShape);
FloatPoint center = floatPointForCenterCoordinate(circle->centerX(), circle->centerY(), FloatSize(boxWidth, boxHeight));
float radius = circle->floatValueForRadiusInBox(FloatSize(boxWidth, boxHeight));
FloatPoint logicalCenter = physicalPointToLogical(center, logicalBoxSize.height().toFloat(), writingMode);
@@ -117,7 +117,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
}
case BasicShape::BasicShapeEllipseType: {
- const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
+ const BasicShapeEllipse* ellipse = toBasicShapeEllipse(basicShape);
FloatPoint center = floatPointForCenterCoordinate(ellipse->centerX(), ellipse->centerY(), FloatSize(boxWidth, boxHeight));
float radiusX = ellipse->floatValueForRadiusInBox(ellipse->radiusX(), center.x(), boxWidth);
float radiusY = ellipse->floatValueForRadiusInBox(ellipse->radiusY(), center.y(), boxHeight);
@@ -128,7 +128,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
}
case BasicShape::BasicShapePolygonType: {
- const BasicShapePolygon* polygon = static_cast<const BasicShapePolygon*>(basicShape);
+ const BasicShapePolygon* polygon = toBasicShapePolygon(basicShape);
const Vector<Length>& values = polygon->values();
size_t valuesSize = values.size();
ASSERT(!(valuesSize % 2));
@@ -144,7 +144,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
}
case BasicShape::BasicShapeInsetType: {
- const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basicShape);
+ const BasicShapeInset& inset = *toBasicShapeInset(basicShape);
float left = floatValueForLength(inset.left(), boxWidth);
float top = floatValueForLength(inset.top(), boxHeight);
float right = floatValueForLength(inset.right(), boxWidth);
« no previous file with comments | « no previous file | Source/core/rendering/style/BasicShapes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698