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

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

Issue 1408123005: Android Webview IPC-based sync compositing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win compile Created 5 years, 1 month 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') | no next file » | 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 3013b0c8cc9b543fbfc0d6291e4bbf4b49cef6ef..32fd2da5605677de3961573d1f79c771a97726ea 100644
--- a/ui/gfx/ipc/gfx_param_traits.cc
+++ b/ui/gfx/ipc/gfx_param_traits.cc
@@ -10,6 +10,7 @@
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
+#include "ui/gfx/geometry/scroll_offset.h"
#include "ui/gfx/range/range.h"
namespace {
@@ -309,6 +310,33 @@ void ParamTraits<gfx::Range>::Log(const gfx::Range& r, std::string* l) {
l->append(base::StringPrintf("(%" PRIuS ", %" PRIuS ")", r.start(), r.end()));
}
+void ParamTraits<gfx::ScrollOffset>::Write(Message* m, const param_type& p) {
+ m->WriteDouble(p.x());
+ m->WriteDouble(p.y());
+}
+
+bool ParamTraits<gfx::ScrollOffset>::Read(const Message* m,
+ base::PickleIterator* iter,
+ param_type* r) {
+ double x = 0.f;
+ double y = 0.f;
+ if (!iter->ReadDouble(&x))
+ return false;
+ if (!iter->ReadDouble(&y))
+ return false;
+ r->set_x(x);
+ r->set_y(y);
+ return true;
+}
+
+void ParamTraits<gfx::ScrollOffset>::Log(const param_type& p, std::string* l) {
+ l->append("(");
+ LogParam(p.x(), l);
+ l->append(", ");
+ LogParam(p.y(), l);
+ l->append(")");
+}
+
} // namespace IPC
// Generate param traits write methods.
« no previous file with comments | « ui/gfx/ipc/gfx_param_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698