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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 16336027: Enable high dpi in win/views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 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/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 9c01ec17e459644e594287dc8618333d741c3dd9..df5ea527e313dcc461b172b73c2f369a635d2072 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -522,12 +522,13 @@ void HWNDMessageHandler::GetWindowPlacement(
}
}
-void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds) {
+void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds_in_pixels) {
LONG style = GetWindowLong(hwnd(), GWL_STYLE);
if (style & WS_MAXIMIZE)
SetWindowLong(hwnd(), GWL_STYLE, style & ~WS_MAXIMIZE);
- SetWindowPos(hwnd(), NULL, bounds.x(), bounds.y(), bounds.width(),
- bounds.height(), SWP_NOACTIVATE | SWP_NOZORDER);
+ SetWindowPos(hwnd(), NULL, bounds_in_pixels.x(), bounds_in_pixels.y(),
+ bounds_in_pixels.width(), bounds_in_pixels.height(),
+ SWP_NOACTIVATE | SWP_NOZORDER);
}
void HWNDMessageHandler::SetSize(const gfx::Size& size) {
@@ -1161,8 +1162,13 @@ void HWNDMessageHandler::RedrawLayeredWindowContents() {
// We need to clip to the dirty rect ourselves.
layered_window_contents_->sk_canvas()->save(SkCanvas::kClip_SaveFlag);
+ double scale = ui::win::GetDeviceScaleFactor();
+ layered_window_contents_->sk_canvas()->scale(
+ SkScalar(scale),SkScalar(scale));
layered_window_contents_->ClipRect(invalid_rect_);
delegate_->PaintLayeredWindow(layered_window_contents_.get());
+ layered_window_contents_->sk_canvas()->scale(
+ SkScalar(1.0/scale),SkScalar(1.0/scale));
layered_window_contents_->sk_canvas()->restore();
RECT wr;
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698