File: view_transition_state_mojom_traits.cc

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (61 lines) | stat: -rw-r--r-- 2,653 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/public/common/frame/view_transition_state_mojom_traits.h"

#include "mojo/public/cpp/base/unguessable_token_mojom_traits.h"
#include "third_party/blink/public/mojom/frame/view_transition_state.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
#include "ui/gfx/mojom/transform_mojom_traits.h"

namespace mojo {

bool StructTraits<
    blink::mojom::ViewTransitionElementLayeredBoxPropertiesDataView,
    blink::ViewTransitionElement::LayeredBoxProperties>::
    Read(blink::mojom::ViewTransitionElementLayeredBoxPropertiesDataView data,
         blink::ViewTransitionElement::LayeredBoxProperties* out) {
  return data.ReadContentBox(&out->content_box) &&
         data.ReadPaddingBox(&out->padding_box) &&
         data.ReadBoxSizing(&out->box_sizing);
}
bool StructTraits<blink::mojom::ViewTransitionElementDataView,
                  blink::ViewTransitionElement>::
    Read(blink::mojom::ViewTransitionElementDataView data,
         blink::ViewTransitionElement* out) {
  if (!data.ReadTagName(&out->tag_name) ||
      !data.ReadBorderBoxRectInEnclosingLayerCssSpace(
          &out->border_box_rect_in_enclosing_layer_css_space) ||
      !data.ReadViewportMatrix(&out->viewport_matrix) ||
      !data.ReadOverflowRectInLayoutSpace(
          &out->overflow_rect_in_layout_space) ||
      !data.ReadSnapshotId(&out->snapshot_id) ||
      !data.ReadCapturedRectInLayoutSpace(
          &out->captured_rect_in_layout_space) ||
      !data.ReadCapturedCssProperties(&out->captured_css_properties) ||
      !data.ReadClassList(&out->class_list) ||
      !data.ReadContainingGroupName(&out->containing_group_name) ||
      !data.ReadLayeredBoxProperties(&out->layered_box_properties)) {
    return false;
  }

  out->paint_order = data.paint_order();
  return true;
}

bool StructTraits<blink::mojom::ViewTransitionStateDataView,
                  blink::ViewTransitionState>::
    Read(blink::mojom::ViewTransitionStateDataView data,
         blink::ViewTransitionState* out) {
  out->device_pixel_ratio = data.device_pixel_ratio();
  out->next_element_resource_id = data.next_element_resource_id();
  return data.ReadElements(&out->elements) &&
         data.ReadTransitionToken(&out->transition_token) &&
         data.ReadSnapshotRootSizeAtCapture(
             &out->snapshot_root_size_at_capture) &&
         data.ReadSubframeSnapshotId(&out->subframe_snapshot_id) &&
         data.ReadIdToAutoNameMap(&out->id_to_auto_name_map);
}

}  // namespace mojo