From 3a70815036e9912c82b73c28d5bd8e678361a319 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 16 Jun 2014 17:58:46 +0000 Subject: [PATCH] Mac: Fix flash on resize (issue #1307) git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1748 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 5850f0fb5..f91630bf0 100644 --- a/cef.gyp +++ b/cef.gyp @@ -1087,6 +1087,9 @@ 'libcef/browser/menu_creator_runner_mac.mm', # 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 158066c6b..346ea88c1 100644 --- a/libcef/browser/browser_host_impl_mac.mm +++ b/libcef/browser/browser_host_impl_mac.mm @@ -17,6 +17,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" @@ -327,6 +328,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();