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

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

Issue 2030033003: Replace cc::ViewportSelectionBound with gfx::SelectionBound (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build compiles locally Created 4 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: 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 abcb24aaebb6db8d772f73b6a042c0c17c9ce4e7..f912fef97dc798af1a85c3968f7f5eccd4f17c40 100644
--- a/ui/gfx/ipc/gfx_param_traits.cc
+++ b/ui/gfx/ipc/gfx_param_traits.cc
@@ -9,6 +9,7 @@
#include <string>
+#include "ui/gfx/ipc/geometry/gfx_param_traits.h"
#include "ui/gfx/range/range.h"
#if defined(OS_MACOSX)
@@ -76,6 +77,55 @@ void ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort>::Log(
}
#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+void ParamTraits<gfx::SelectionBound>::GetSize(base::PickleSizer* s,
+ const param_type& p) {
+ GetParamSize(s, static_cast<uint32_t>(p.type()));
+ GetParamSize(s, p.edge_top());
+ GetParamSize(s, p.edge_bottom());
+ GetParamSize(s, p.visible());
+}
+
+void ParamTraits<gfx::SelectionBound>::Write(base::Pickle* m,
+ const param_type& p) {
+ WriteParam(m, static_cast<uint32_t>(p.type()));
+ WriteParam(m, p.edge_top());
+ WriteParam(m, p.edge_bottom());
+ WriteParam(m, p.visible());
+}
+
+bool ParamTraits<gfx::SelectionBound>::Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r) {
+ gfx::SelectionBound::Type type;
+ gfx::PointF edge_top;
+ gfx::PointF edge_bottom;
+ bool visible = false;
+
+ if (!ReadParam(m, iter, &type) || !ReadParam(m, iter, &edge_top) ||
+ !ReadParam(m, iter, &edge_bottom) || !ReadParam(m, iter, &visible)) {
+ return false;
+ }
+
+ r->set_type(type);
+ r->SetEdgeTop(edge_top);
+ r->SetEdgeBottom(edge_bottom);
+ r->set_visible(visible);
+ return true;
+}
+
+void ParamTraits<gfx::SelectionBound>::Log(const param_type& p,
+ std::string* l) {
+ l->append("gfx::SelectionBound(");
+ LogParam(static_cast<uint32_t>(p.type()), l);
+ l->append(", ");
+ LogParam(p.edge_top(), l);
+ l->append(", ");
+ LogParam(p.edge_bottom(), l);
+ l->append(", ");
+ LogParam(p.visible(), l);
+ l->append(")");
+}
+
} // namespace IPC
// Generate param traits size methods.

Powered by Google App Engine
This is Rietveld 408576698