| Index: ui/gfx/gdi_util.cc
|
| diff --git a/ui/gfx/gdi_util.cc b/ui/gfx/gdi_util.cc
|
| index 5ba5d7263f6783ff41f1c0ea791edadb70cae4c5..f54862856e01d68e532428861ebf25d22fb5c92e 100644
|
| --- a/ui/gfx/gdi_util.cc
|
| +++ b/ui/gfx/gdi_util.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "ui/gfx/gdi_util.h"
|
|
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| namespace gfx {
|
|
|
| void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
|
| @@ -76,6 +78,24 @@ void SubtractRectanglesFromRegion(HRGN hrgn,
|
| }
|
| }
|
|
|
| +HRGN ConvertPathToHRGN(const gfx::Path& path) {
|
| +#if defined(USE_AURA)
|
| + int point_count = path.getPoints(NULL, 0);
|
| + scoped_array<SkPoint> points(new SkPoint[point_count]);
|
| + path.getPoints(points.get(), point_count);
|
| + scoped_array<POINT> windows_points(new POINT[point_count]);
|
| + for (int i = 0; i < point_count; ++i) {
|
| + windows_points[i].x = SkScalarRound(points[i].fX);
|
| + windows_points[i].y = SkScalarRound(points[i].fY);
|
| + }
|
| +
|
| + return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE);
|
| +#elif defined(OS_WIN)
|
| + return path.CreateNativeRegion();
|
| +#endif
|
| +}
|
| +
|
| +
|
| double CalculatePageScale(HDC dc, int page_width, int page_height) {
|
| int dc_width = GetDeviceCaps(dc, HORZRES);
|
| int dc_height = GetDeviceCaps(dc, VERTRES);
|
|
|