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

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

Issue 347653005: Make cross-process CALayers work on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@image_transport_1
Patch Set: Incorporate review feedback Created 6 years, 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/base/cocoa/remote_layer_api.h"
6
7 #include <objc/runtime.h>
8
9 namespace ui {
10
11 bool RemoteLayerAPISupported() {
12 // Verify the GPU process interfaces are present.
13 static Class caContextClass = NSClassFromString(@"CAContext");
14 if (!caContextClass)
15 return false;
16
17 // Note that because the contextId and layer properties are dynamic,
18 // instancesRespondToSelector will return NO for them.
19 static bool caContextClassValid =
20 [caContextClass respondsToSelector:
21 @selector(contextWithCGSConnection:options:)] &&
22 class_getProperty(caContextClass, "contextId") &&
23 class_getProperty(caContextClass, "layer");
24 if (!caContextClassValid)
25 return false;
26
27 // Verify the browser process interfaces are present.
28 static Class caLayerHostClass = NSClassFromString(@"CALayerHost");
29 if (!caLayerHostClass)
30 return false;
31
32 static bool caLayerHostClassValid =
33 [caLayerHostClass instancesRespondToSelector:@selector(contextId)] &&
34 [caLayerHostClass instancesRespondToSelector:@selector(setContextId:)];
35 if (!caLayerHostClassValid)
36 return false;
37
38 // If everything is there, we should be able to use the API.
39 return true;
40 }
41
42 } // namespace
43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698