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

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

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/ipc/gfx_param_traits.h ('k') | ui/gfx/mac/io_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/ipc/gfx_param_traits.cc
diff --git a/ui/gfx/ipc/gfx_param_traits.cc b/ui/gfx/ipc/gfx_param_traits.cc
index 2eeefbf0580d4619ffab706812960a06f46310f4..a49e1da95980c0d1406080cf28ecfb2a52b49622 100644
--- a/ui/gfx/ipc/gfx_param_traits.cc
+++ b/ui/gfx/ipc/gfx_param_traits.cc
@@ -16,6 +16,10 @@
#include "ui/gfx/geometry/scroll_offset.h"
#include "ui/gfx/range/range.h"
+#if defined(OS_MACOSX)
+#include "ipc/mach_port_mac.h"
+#endif
+
namespace {
struct SkBitmap_Data {
@@ -340,6 +344,33 @@ void ParamTraits<gfx::ScrollOffset>::Log(const param_type& p, std::string* l) {
l->append(")");
}
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Write(
+ Message* m,
+ const param_type p) {
+ MachPortMac mach_port_mac(p.get());
+ ParamTraits<MachPortMac>::Write(m, mach_port_mac);
+}
+
+bool ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Read(
+ const Message* m,
+ base::PickleIterator* iter,
+ param_type* r) {
+ MachPortMac mach_port_mac;
+ if (!ParamTraits<MachPortMac>::Read(m, iter, &mach_port_mac))
+ return false;
+ r->reset(mach_port_mac.get_mach_port());
+ return true;
+}
+
+void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Log(
+ const param_type& p,
+ std::string* l) {
+ l->append("IOSurface Mach send right: ");
+ LogParam(p.get(), l);
+}
+#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+
} // namespace IPC
// Generate param traits write methods.
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.h ('k') | ui/gfx/mac/io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698