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

Unified Diff: ui/gfx/gdi_util.cc

Issue 10662037: basic nc paint, moving, resizing for views_examples_exe on win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetHwnd->hwnd Created 8 years, 6 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 | « ui/gfx/gdi_util.h ('k') | ui/gfx/path_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « ui/gfx/gdi_util.h ('k') | ui/gfx/path_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698