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

Unified Diff: content/common/gpu/surface_handle_types_mac.h

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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/surface_handle_types_mac.h
diff --git a/content/common/gpu/surface_handle_types_mac.h b/content/common/gpu/surface_handle_types_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3ca1af082f11acb11d06d5ffb81c344b13c5186
--- /dev/null
+++ b/content/common/gpu/surface_handle_types_mac.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_SURFACE_HANDLE_TYPES_MAC_H_
+#define CONTENT_COMMON_GPU_SURFACE_HANDLE_TYPES_MAC_H_
+
+#include <OpenGL/CGLIOSurface.h>
+
+#include "base/basictypes.h"
+#include "ui/base/cocoa/remote_layer_api.h"
+
+namespace content {
+
+// The surface handle passed between the GPU and browser process may refer to
+// an IOSurface or a CAContext. These helper functions must be used to identify
+// and translate between the types.
+enum SurfaceHandleType {
+ kSurfaceHandleTypeInvalid,
+ kSurfaceHandleTypeIOSurface,
+ kSurfaceHandleTypeCAContext,
+};
+
+SurfaceHandleType GetSurfaceHandleType(uint64 surface_handle);
+
+CAContextID CAContextIDFromSurfaceHandle(uint64 surface_handle);
+IOSurfaceID IOSurfaceIDFromSurfaceHandle(uint64 surface_handle);
+
+uint64 SurfaceHandleFromIOSurfaceID(IOSurfaceID io_surface_id);
+uint64 SurfaceHandleFromCAContextID(CAContextID ca_context_id);
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_HANDLE_TYPES_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698