Lines Matching refs:gfx
1194 module gfx.mojom;
1218 [`gfx::Rect`](https://cs.chromium.org/chromium/src/ui/gfx/geometry/rect.h) which
1220 manually converting between a `gfx::Rect` and the Mojom-generated `RectPtr` at
1227 virtual void FillRect(const gfx::Rect& rect) = 0;
1237 viral concept: if `gfx::mojom::Rect` is mapped to `gfx::Rect` anywhere, the
1246 For now, let's take a look at how to express the mapping from `gfx::mojom::Rect`
1247 to `gfx::Rect`.
1276 In order to define the mapping for `gfx::Rect`, we want the following
1278 `//ui/gfx/geometry/mojo/geometry_struct_traits.h`:
1282 #include "ui/gfx/geometry/rect.h"
1283 #include "ui/gfx/geometry/mojo/geometry.mojom.h"
1288 class StructTraits<gfx::mojom::RectDataView, gfx::Rect> {
1290 static int32_t x(const gfx::Rect& r) { return r.x(); }
1291 static int32_t y(const gfx::Rect& r) { return r.y(); }
1292 static int32_t width(const gfx::Rect& r) { return r.width(); }
1293 static int32_t height(const gfx::Rect& r) { return r.height(); }
1295 static bool Read(gfx::mojom::RectDataView data, gfx::Rect* out_rect);
1301 And in `//ui/gfx/geometry/mojo/geometry_struct_traits.cc`:
1304 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
1310 bool StructTraits<gfx::mojom::RectDataView, gfx::Rect>::Read(
1311 gfx::mojom::RectDataView data,
1312 gfx::Rect* out_rect) {
1325 deserialization: if a client sends a `gfx::Rect` with a negative width or
1340 mojom = "//ui/gfx/geometry/mojo/geometry.mojom"
1341 public_headers = [ "//ui/gfx/geometry/rect.h" ]
1342 traits_headers = [ "//ui/gfx/geometry/mojo/geometry_struct_traits.h" ]
1344 "//ui/gfx/geometry/mojo/geometry_struct_traits.cc",
1345 "//ui/gfx/geometry/mojo/geometry_struct_traits.h",
1347 public_deps = [ "//ui/gfx/geometry" ]
1349 "gfx.mojom.Rect=gfx::Rect",
1359 on the Mojom definition of `gfx.mojom.Rect` now that the typemap is applied.
1397 `//ui/gfx/typemaps.gni` file with the following contents:
1401 "//ui/gfx/geometry/mojo/geometry.typemap",
1412 "//ui/gfx/typemaps.gni",
1498 const gfx::Rect& left() const { return left_; }
1499 const gfx::Rect& right() const { return right_; }
1501 void Set(const gfx::Rect& left, const gfx::Rect& right) {
1509 gfx::Rect left_;
1510 gfx::Rect right_;
1514 Our traits to map `gfx::mojom::RectPair` to `gfx::RectPair` might look like
1523 static const gfx::Rect& left(const gfx::RectPair& pair) {
1527 static const gfx::Rect& right(const gfx::RectPair& pair) {
1531 static bool Read(gfx::mojom::RectPairDataView data, gfx::RectPair* out_pair) {
1532 gfx::Rect left, right;