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

Unified Diff: chrome/browser/ui/cocoa/nsview_additions.mm

Issue 184433005: Give the browser window's content view a CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
Index: chrome/browser/ui/cocoa/nsview_additions.mm
diff --git a/chrome/browser/ui/cocoa/nsview_additions.mm b/chrome/browser/ui/cocoa/nsview_additions.mm
index d6241e62cf867533ded750658dd63e359b685101..fc9291df4fd118888d35781a4552684fdf0c1b45 100644
--- a/chrome/browser/ui/cocoa/nsview_additions.mm
+++ b/chrome/browser/ui/cocoa/nsview_additions.mm
@@ -6,6 +6,7 @@
#include "base/mac/mac_util.h"
#import "chrome/browser/ui/cocoa/nsview_additions.h"
#include "chrome/common/chrome_switches.h"
+#include "ui/base/cocoa/animation_utils.h"
#include "ui/base/ui_base_switches.h"
#include "base/logging.h"
@@ -117,4 +118,16 @@
[self setCanDrawSubviewsIntoLayer:YES];
}
+- (void)cr_setHostsSolidWhiteLayer {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableCoreAnimation))
+ return;
+
+ ScopedCAActionDisabler disabler;
+ CALayer* layer = [[CALayer alloc] init];
Avi (use Gerrit) 2014/03/05 03:19:28 This looks like it leaks. scoped_nsobject?
ccameron 2014/03/05 07:59:31 Yes, it does leak. The setLayer will take out a re
+ [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+ [self setLayer:layer];
+ [self setWantsLayer:YES];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698