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

Unified Diff: content/app/content_main_runner.cc

Issue 903943002: Mac: Make content shell work with remote CoreAnimation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to ContentMainRunnerImpl Created 5 years, 7 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 | « chrome/browser/chrome_browser_main_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 4c8dcbb99c45b9cf19b2637411e2253892f9d1d4..14d8d37f5730e127b561baf0f1335e8deb007df1 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -83,7 +83,11 @@
#elif defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#if !defined(OS_IOS)
+#include <CoreFoundation/CoreFoundation.h>
+#include "base/mac/mac_util.h"
+#include "base/mac/scoped_cftyperef.h"
#include "base/power_monitor/power_monitor_device_source.h"
+#include "base/strings/sys_string_conversions.h"
#include "content/browser/mach_broker_mac.h"
#include "content/common/sandbox_init_mac.h"
#endif // !OS_IOS
@@ -551,6 +555,20 @@ class ContentMainRunnerImpl : public ContentMainRunner {
// app quits. Each "main" needs to flush this pool right before it goes into
// its main event loop to get rid of the cruft.
autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool());
+
+ // CoreAnimation has poor performance and CoreAnimation and
+ // non-CoreAnimation exhibit window flickering when layers are not hosted
+ // in the window server, which is the default when not not using the
+ // 10.9 SDK.
+ // TODO: Remove this when we build with the 10.9 SDK (or higher).
+ if (base::mac::IsOSMavericksOrLater()) {
+ base::ScopedCFTypeRef<CFStringRef> key(base::SysUTF8ToCFStringRef(
+ "NSWindowHostsLayersInWindowServer"));
+ base::ScopedCFTypeRef<CFStringRef> value(base::SysUTF8ToCFStringRef(
+ "YES"));
+ CFPreferencesSetAppValue(
+ key, value, kCFPreferencesCurrentApplication);
Avi (use Gerrit) 2015/05/07 19:54:44 CFPreferencesSetAppValue is different than -[NSUse
+ }
#endif
// On Android, the command line is initialized when library is loaded and
« no previous file with comments | « chrome/browser/chrome_browser_main_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698