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

Unified Diff: ui/views/widget/native_widget_mac.mm

Issue 1689483002: MacViews: Implement NativeWidgetMac::SchedulePaintInRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 10 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 | « no previous file | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac.mm
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 4d0212457e3a2a56e7d871b84268542b76d18f49..4be92c4e32031b1c76811e71a4d585107d438ea8 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -504,9 +504,15 @@ void NativeWidgetMac::RunShellDrag(View* view,
}
void NativeWidgetMac::SchedulePaintInRect(const gfx::Rect& rect) {
- // TODO(tapted): This should use setNeedsDisplayInRect:, once the coordinate
- // system of |rect| has been converted.
- [GetNativeView() setNeedsDisplay:YES];
+ // |rect| is relative to client area of the window.
+ NSWindow* window = GetNativeWindow();
+ NSRect client_rect = [window contentRectForFrameRect:[window frame]];
+ NSRect target_rect = rect.ToCGRect();
+
+ // Convert to Appkit coordinate system (origin at bottom left).
+ target_rect.origin.y =
+ NSHeight(client_rect) - target_rect.origin.y - NSHeight(target_rect);
+ [GetNativeView() setNeedsDisplayInRect:target_rect];
if (bridge_ && bridge_->layer())
bridge_->layer()->SchedulePaint(rect);
}
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698