diff options
author | scottmg <scottmg@chromium.org> | 2015-04-30 13:30:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-30 20:30:34 +0000 |
commit | 76cb78651198ca8901524a7d2db70bc2a6521004 (patch) | |
tree | f1a5f53e285ad574fdb14c26b4cba6c0a0a4c663 /printing | |
parent | f216941879b069326ff0be6912e77282d2567a99 (diff) | |
download | chromium_src-76cb78651198ca8901524a7d2db70bc2a6521004.zip chromium_src-76cb78651198ca8901524a7d2db70bc2a6521004.tar.gz chromium_src-76cb78651198ca8901524a7d2db70bc2a6521004.tar.bz2 |
vs2015: avoid int->float warning in printing/emf_win.cc
d:\src\cr2\src\printing\emf_win.cc(548): warning C4838: conversion from 'int' to 'FLOAT' requires a narrowing conversion
d:\src\cr2\src\printing\emf_win.cc(569): warning C4838: conversion from 'int' to 'FLOAT' requires a narrowing conversion
R=alekseys@chromium.org
BUG=440500
Review URL: https://codereview.chromium.org/1113113002
Cr-Commit-Position: refs/heads/master@{#327781}
Diffstat (limited to 'printing')
-rw-r--r-- | printing/emf_win.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc index 2afa1dd..b9dc987 100644 --- a/printing/emf_win.cc +++ b/printing/emf_win.cc @@ -554,8 +554,8 @@ scoped_ptr<Emf> Emf::RasterizeMetafile(int raster_area_in_pixels) const { XFORM xform = { float(page_bounds.width()) / bitmap_rect.width(), 0, 0, float(page_bounds.height()) / bitmap_rect.height(), - page_bounds.x(), - page_bounds.y(), + static_cast<float>(page_bounds.x()), + static_cast<float>(page_bounds.y()), }; ::SetWorldTransform(hdc, &xform); ::BitBlt(hdc, 0, 0, bitmap_rect.width(), bitmap_rect.height(), @@ -577,7 +577,12 @@ scoped_ptr<Emf> Emf::RasterizeAlphaBlend() const { RasterBitmap bitmap(page_bounds.size()); // Map metafile page_bounds.x(), page_bounds.y() to bitmap 0, 0. - XFORM xform = { 1, 0, 0, 1, -page_bounds.x(), -page_bounds.y()}; + XFORM xform = {1, + 0, + 0, + 1, + static_cast<float>(-page_bounds.x()), + static_cast<float>(-page_bounds.y())}; ::SetWorldTransform(bitmap.context(), &xform); scoped_ptr<Emf> result(new Emf); |