From 7a409f16d24251674b37a0e7d5c9cd7539898bb8 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 16 Jun 2014 17:59:00 +0000 Subject: [PATCH] Mac: Fix flash on resize (issue #1307) git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1916@1749 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef.gyp | 3 +++ libcef/browser/browser_host_impl_mac.mm | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/cef.gyp b/cef.gyp index a737f25d7..86b89e0a8 100644 --- a/cef.gyp +++ b/cef.gyp @@ -1134,6 +1134,9 @@ 'libcef/browser/web_contents_view_osr.h', # Include sources for printing. '<(DEPTH)/chrome/renderer/printing/print_web_view_helper_mac.mm', + # Include sources for CoreAnimation support. + '<(DEPTH)/chrome/browser/ui/cocoa/nsview_additions.h', + '<(DEPTH)/chrome/browser/ui/cocoa/nsview_additions.mm', ], }], [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { diff --git a/libcef/browser/browser_host_impl_mac.mm b/libcef/browser/browser_host_impl_mac.mm index ad768aac6..2044f449c 100644 --- a/libcef/browser/browser_host_impl_mac.mm +++ b/libcef/browser/browser_host_impl_mac.mm @@ -19,6 +19,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" +#import "chrome/browser/ui/cocoa/nsview_additions.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" @@ -383,6 +384,11 @@ bool CefBrowserHostImpl::PlatformCreateWindow() { window_info_.parent_view = parentView; } + // Make the content view for the window have a layer. This will make all + // sub-views have layers. This is necessary to ensure correct layer + // ordering of all child views and their layers. + [[[parentView window] contentView] cr_setWantsLayer:YES]; + // Add a reference that will be released in the dealloc handler. AddRef();