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

Unified Diff: mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc

Issue 558343004: Compositor bindings for mojo html_viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_view_manager_surface
Patch Set: Add missing m/s/p/cpp/v_m -> m/s/p/cpp/surfaces dep in GN Created 6 years, 3 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: mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
diff --git a/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc b/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
index 5a21f24ec76baf0e6df706c550dce80a4f19e700..9a40c1515bce6e2439f5c558d18bb99fa315c644 100644
--- a/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
+++ b/mojo/services/public/cpp/geometry/lib/geometry_type_converters.cc
@@ -71,6 +71,23 @@ gfx::Rect TypeConverter<gfx::Rect, RectPtr>::Convert(const RectPtr& input) {
}
// static
+RectFPtr TypeConverter<RectFPtr, gfx::RectF>::Convert(const gfx::RectF& input) {
+ RectFPtr rect(RectF::New());
+ rect->x = input.x();
+ rect->y = input.y();
+ rect->width = input.width();
+ rect->height = input.height();
+ return rect.Pass();
+}
+
+// static
+gfx::RectF TypeConverter<gfx::RectF, RectFPtr>::Convert(const RectFPtr& input) {
+ if (input.is_null())
+ return gfx::RectF();
+ return gfx::RectF(input->x, input->y, input->width, input->height);
+}
+
+// static
TransformPtr TypeConverter<TransformPtr, gfx::Transform>::Convert(
const gfx::Transform& input) {
std::vector<float> storage(16);

Powered by Google App Engine
This is Rietveld 408576698