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

Unified Diff: src/svg/parser/SkSVGSVG.cpp

Issue 1135693003: Revert of Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « src/ports/SkFontHost_FreeType.cpp ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/svg/parser/SkSVGSVG.cpp
diff --git a/src/svg/parser/SkSVGSVG.cpp b/src/svg/parser/SkSVGSVG.cpp
index fcce62de9e8338704551139298d7c2ba2baea65a..61ccb3c8196218572b713503b2bf705da97246e3 100644
--- a/src/svg/parser/SkSVGSVG.cpp
+++ b/src/svg/parser/SkSVGSVG.cpp
@@ -43,11 +43,8 @@
if (strcmp(wSuffix, "pt") == 0)
width = SkScalarMulDiv(width, SK_Scalar1 * 72, SK_Scalar1 * 96);
SkParse::FindScalars(f_viewBox.c_str(), viewBox, 4);
- SkRect box;
- box.fLeft = SkScalarDiv(viewBox[0], width);
- box.fTop = SkScalarDiv(viewBox[1], height);
- box.fRight = SkScalarDiv(viewBox[2], width);
- box.fBottom = SkScalarDiv(viewBox[3], height);
+ SkRect box = SkRect::MakeLTRB(viewBox[0] / width, viewBox[1] / height,
+ viewBox[2] / width, viewBox[3] / height);
if (box.fLeft == 0 && box.fTop == 0 &&
box.fRight == SK_Scalar1 && box.fBottom == SK_Scalar1)
return;
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698