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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 11418244: Order the GL overlays above windows if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops, null check Created 8 years, 1 month 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
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index fb8db750f25db301108bafa1a0d1ab8870b39ea2..23e26f485f4f915a86ed5a23ed502fb9908c5d55 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -289,6 +289,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget)
last_frame_was_accelerated_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
can_compose_inline_(true),
+ allow_overlapping_views_(false),
is_loading_(false),
is_hidden_(false),
weak_factory_(this),
@@ -316,6 +317,10 @@ void RenderWidgetHostViewMac::SetDelegate(
[cocoa_view_ setRWHVDelegate:delegate];
}
+void RenderWidgetHostViewMac::SetAllowOverlappingViews(bool overlapping) {
+ allow_overlapping_views_ = overlapping;
+}
+
///////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewMac, RenderWidgetHostView implementation:
@@ -1046,8 +1051,12 @@ bool RenderWidgetHostViewMac::CompositorSwapBuffers(uint64 surface_handle,
return true;
}
- if (!compositing_iosurface_.get())
- compositing_iosurface_.reset(CompositingIOSurfaceMac::Create());
+ if (!compositing_iosurface_.get()) {
+ CompositingIOSurfaceMac::SurfaceOrder order = allow_overlapping_views_ ?
+ CompositingIOSurfaceMac::SURFACE_ORDER_BELOW_WINDOW :
+ CompositingIOSurfaceMac::SURFACE_ORDER_ABOVE_WINDOW;
+ compositing_iosurface_.reset(CompositingIOSurfaceMac::Create(order));
+ }
if (!compositing_iosurface_.get())
return true;
@@ -2308,15 +2317,16 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
if (renderWidgetHostView_->last_frame_was_accelerated_ &&
renderWidgetHostView_->compositing_iosurface_.get()) {
- {
+ if (renderWidgetHostView_->allow_overlapping_views_) {
+ // If overlapping views need to be allowed, punch a hole in the window
+ // to expose the GL underlay.
TRACE_EVENT2("gpu", "NSRectFill clear", "w", damagedRect.width(),
"h", damagedRect.height());
- // Draw transparency to expose the GL underlay. NSRectFill is extremely
- // slow (15ms for a window on a fast MacPro), so this is only done when
- // it's a real invalidation from window damage (not when a BuffersSwapped
- // was received). Note that even a 1x1 NSRectFill can take many
- // milliseconds sometimes (!) so this is skipped completely for drawRects
- // that are triggered by BuffersSwapped messages.
+ // NSRectFill is extremely slow (15ms for a window on a fast MacPro), so
+ // this is only done when it's a real invalidation from window damage (not
+ // when a BuffersSwapped was received). Note that even a 1x1 NSRectFill
+ // can take many milliseconds sometimes (!) so this is skipped completely
+ // for drawRects that are triggered by BuffersSwapped messages.
[[NSColor clearColor] set];
NSRectFill(dirtyRect);
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | content/browser/web_contents/web_contents_view_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698