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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 654393002: MacViews: Fix WidgetTest.DesktopNativeWidgetNoPaintAfterCloseTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ReadReceivedPaintAndReset Created 6 years, 2 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/cocoa/bridged_content_view.h ('k') | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index 66624a1a355b4960d9d6ce4cc3efa81f632db99f..3a772073c9ec86b15f16ccfbf56537f10f2b105d 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -30,6 +30,7 @@
@synthesize hostedView = hostedView_;
@synthesize textInputClient = textInputClient_;
+@synthesize willShow = willShow_;
- (id)initWithView:(views::View*)viewToHost {
DCHECK(viewToHost);
@@ -89,11 +90,13 @@
}
- (void)drawRect:(NSRect)dirtyRect {
- if (!hostedView_)
+ // Note that on a Show, Cocoa calls drawRect: before changing
+ // -[NSWindow isVisible], hence the extra check.
+ if (!hostedView_ || (!willShow_ && ![[self window] isVisible]))
return;
gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */);
- hostedView_->Paint(&canvas, views::CullSet());
+ hostedView_->GetWidget()->OnNativeWidgetPaint(&canvas);
}
// NSResponder implementation.
« no previous file with comments | « ui/views/cocoa/bridged_content_view.h ('k') | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698