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

Side by Side Diff: ui/base/cocoa/remote_layer_api.mm

Issue 474723002: Enable remote CoreAnimation API by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_flag
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/cocoa/remote_layer_api.h" 5 #include "ui/base/cocoa/remote_layer_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "ui/base/ui_base_switches.h" 8 #include "ui/base/ui_base_switches.h"
9 9
10 #include <objc/runtime.h> 10 #include <objc/runtime.h>
11 11
12 namespace ui { 12 namespace ui {
13 13
14 bool RemoteLayerAPISupported() { 14 bool RemoteLayerAPISupported() {
15 static bool enabled_at_command_line = 15 static bool disabled_at_command_line =
sky 2014/08/14 00:19:34 Same comment about static here.
ccameron 2014/08/14 00:33:55 Done.
16 CommandLine::ForCurrentProcess()->HasSwitch( 16 CommandLine::ForCurrentProcess()->HasSwitch(
17 switches::kEnableRemoteCoreAnimation); 17 switches::kDisableRemoteCoreAnimation);
18 if (!enabled_at_command_line) 18 if (disabled_at_command_line)
19 return false; 19 return false;
20 20
21 // Verify the GPU process interfaces are present. 21 // Verify the GPU process interfaces are present.
22 static Class caContextClass = NSClassFromString(@"CAContext"); 22 static Class caContextClass = NSClassFromString(@"CAContext");
23 if (!caContextClass) 23 if (!caContextClass)
24 return false; 24 return false;
25 25
26 // Note that because the contextId and layer properties are dynamic, 26 // Note that because the contextId and layer properties are dynamic,
27 // instancesRespondToSelector will return NO for them. 27 // instancesRespondToSelector will return NO for them.
28 static bool caContextClassValid = 28 static bool caContextClassValid =
(...skipping 14 matching lines...) Expand all
43 [caLayerHostClass instancesRespondToSelector:@selector(setContextId:)]; 43 [caLayerHostClass instancesRespondToSelector:@selector(setContextId:)];
44 if (!caLayerHostClassValid) 44 if (!caLayerHostClassValid)
45 return false; 45 return false;
46 46
47 // If everything is there, we should be able to use the API. 47 // If everything is there, we should be able to use the API.
48 return true; 48 return true;
49 } 49 }
50 50
51 } // namespace 51 } // namespace
52 52
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698