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

Unified Diff: skia/ext/vector_platform_device_emf_win.cc

Issue 122443005: replace deprecated SkScalarRound/Floor/Ceil calls with more explicit variants (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | « skia/ext/skia_utils_win.cc ('k') | skia/skia_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/vector_platform_device_emf_win.cc
diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc
index 69758047b45c05adc23605fa407795cbb1f7371a..f77fbc8d20d8d714f20544f7f59295b638a4d52c 100644
--- a/skia/ext/vector_platform_device_emf_win.cc
+++ b/skia/ext/vector_platform_device_emf_win.cc
@@ -201,10 +201,10 @@ void VectorPlatformDeviceEmf::drawRect(const SkDraw& draw,
return;
}
HDC dc = BeginPlatformPaint();
- if (!Rectangle(dc, SkScalarRound(rect.fLeft),
- SkScalarRound(rect.fTop),
- SkScalarRound(rect.fRight),
- SkScalarRound(rect.fBottom))) {
+ if (!Rectangle(dc, SkScalarRoundToInt(rect.fLeft),
+ SkScalarRoundToInt(rect.fTop),
+ SkScalarRoundToInt(rect.fRight),
+ SkScalarRoundToInt(rect.fBottom))) {
SkASSERT(false);
}
EndPlatformPaint();
@@ -400,7 +400,7 @@ bool SkGDIFontSetup::useGDI(HDC hdc, const SkPaint& paint) {
LOGFONT lf;
SkLOGFONTFromTypeface(paint.getTypeface(), &lf);
- lf.lfHeight = -SkScalarRound(paint.getTextSize());
+ lf.lfHeight = -SkScalarRoundToInt(paint.getTextSize());
fNewFont = CreateFontIndirect(&lf);
fSavedFont = (HFONT)::SelectObject(hdc, fNewFont);
fHDC = hdc;
@@ -488,8 +488,8 @@ void VectorPlatformDeviceEmf::drawText(const SkDraw& draw,
&& setup.useGDI(hdc_, paint)) {
UINT options = getTextOutOptions(paint);
UINT count = byteLength >> 1;
- useDrawPath = !EnsureExtTextOut(hdc_, SkScalarRound(x),
- SkScalarRound(y + getAscent(paint)), options, 0,
+ useDrawPath = !EnsureExtTextOut(hdc_, SkScalarRoundToInt(x),
+ SkScalarRoundToInt(y + getAscent(paint)), options, 0,
reinterpret_cast<const wchar_t*>(text), count, NULL,
paint.getTypeface());
}
@@ -527,13 +527,13 @@ void VectorPlatformDeviceEmf::drawPosText(const SkDraw& draw,
if (2 == scalarsPerPos
&& SkPaint::kUTF8_TextEncoding != paint.getTextEncoding()
&& setup.useGDI(hdc_, paint)) {
- int startX = SkScalarRound(pos[0]);
- int startY = SkScalarRound(pos[1] + getAscent(paint));
+ int startX = SkScalarRoundToInt(pos[0]);
+ int startY = SkScalarRoundToInt(pos[1] + getAscent(paint));
const int count = len >> 1;
SkAutoSTMalloc<64, INT> storage(count);
INT* advances = storage.get();
for (int i = 0; i < count - 1; ++i) {
- advances[i] = SkScalarRound(pos[2] - pos[0]);
+ advances[i] = SkScalarRoundToInt(pos[2] - pos[0]);
pos += 2;
}
useDrawText = !EnsureExtTextOut(hdc_, startX, startY,
@@ -860,7 +860,7 @@ bool VectorPlatformDeviceEmf::CreatePen(bool use_pen, const SkPaint& paint) {
return CreatePen(use_pen,
SkColorToCOLORREF(paint.getColor()),
- SkScalarRound(paint.getStrokeWidth()),
+ SkScalarRoundToInt(paint.getStrokeWidth()),
paint.getStrokeMiter(),
pen_style);
}
« no previous file with comments | « skia/ext/skia_utils_win.cc ('k') | skia/skia_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698