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

Unified Diff: ui/gfx/ipc/gfx_param_traits.h

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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 | « ui/gfx/gpu_memory_buffer.cc ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/ipc/gfx_param_traits.h
diff --git a/ui/gfx/ipc/gfx_param_traits.h b/ui/gfx/ipc/gfx_param_traits.h
index 337505a20ee7bf04dd251058831aed94eea8c54f..b7280ef0510ec4f0f026d215482e398530c796da 100644
--- a/ui/gfx/ipc/gfx_param_traits.h
+++ b/ui/gfx/ipc/gfx_param_traits.h
@@ -13,6 +13,10 @@
#include "ui/gfx/ipc/gfx_ipc_export.h"
#include "ui/gfx/ipc/gfx_param_traits_macros.h"
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+#include "ui/gfx/mac/io_surface.h"
+#endif
+
class SkBitmap;
namespace gfx {
@@ -131,6 +135,20 @@ struct GFX_IPC_EXPORT ParamTraits<gfx::ScrollOffset> {
static void Log(const param_type& p, std::string* l);
};
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+template <>
+struct GFX_IPC_EXPORT ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort> {
+ typedef gfx::ScopedRefCountedIOSurfaceMachPort param_type;
+ static void Write(Message* m, const param_type p);
+ // Note: Read() passes ownership of the Mach send right from the IPC message
+ // to the ScopedRefCountedIOSurfaceMachPort. Therefore, Read() may only be
+ // called once for a given message, otherwise the singular right will be
+ // managed and released by two objects.
+ static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
+};
+#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+
} // namespace IPC
#endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_
« no previous file with comments | « ui/gfx/gpu_memory_buffer.cc ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698