summaryrefslogtreecommitdiffstats
path: root/cc/output/compositor_frame_metadata.h
blob: 54b2047fcd64542aa2aee283aeac45672f0938d7 (plain)
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
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_OUTPUT_COMPOSITOR_FRAME_METADATA_H_
#define CC_OUTPUT_COMPOSITOR_FRAME_METADATA_H_

#include <stdint.h>

#include <vector>

#include "cc/base/cc_export.h"
#include "cc/output/viewport_selection_bound.h"
#include "cc/surfaces/surface_id.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/geometry/vector2d_f.h"

namespace cc {

class CC_EXPORT CompositorFrameMetadata {
 public:
  CompositorFrameMetadata();
  CompositorFrameMetadata(const CompositorFrameMetadata& other);
  ~CompositorFrameMetadata();

  // The device scale factor used to generate this compositor frame.
  float device_scale_factor;

  // Scroll offset and scale of the root layer. This can be used for tasks
  // like positioning windowed plugins.
  gfx::Vector2dF root_scroll_offset;
  float page_scale_factor;

  // These limits can be used together with the scroll/scale fields above to
  // determine if scrolling/scaling in a particular direction is possible.
  gfx::SizeF scrollable_viewport_size;
  gfx::SizeF root_layer_size;
  float min_page_scale_factor;
  float max_page_scale_factor;
  bool root_overflow_x_hidden;
  bool root_overflow_y_hidden;

  // Used to position the Android location top bar and page content, whose
  // precise position is computed by the renderer compositor.
  gfx::Vector2dF location_bar_offset;
  gfx::Vector2dF location_bar_content_translation;

  // This color is usually obtained from the background color of the <body>
  // element. It can be used for filling in gutter areas around the frame when
  // it's too small to fill the box the parent reserved for it.
  SkColor root_background_color;

  // Provides selection region updates relative to the current viewport. If the
  // selection is empty or otherwise unused, the bound types will indicate such.
  ViewportSelection selection;

  std::vector<ui::LatencyInfo> latency_info;

  // A set of SurfaceSequences that this frame satisfies (always in the same
  // namespace as the current Surface).
  std::vector<uint32_t> satisfies_sequences;

  // This is the set of Surfaces that are referenced by this frame.
  std::vector<SurfaceId> referenced_surfaces;
};

}  // namespace cc

#endif  // CC_OUTPUT_COMPOSITOR_FRAME_METADATA_H_