Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / cc / output / overlay_candidate.h
blob28ecfabe184b7eb8cb757d1aa0885d59ed818f69
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_OUTPUT_OVERLAY_CANDIDATE_H_
6 #define CC_OUTPUT_OVERLAY_CANDIDATE_H_
8 #include <vector>
10 #include "cc/base/cc_export.h"
11 #include "cc/resources/resource_format.h"
12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/rect_f.h"
14 #include "ui/gfx/geometry/size.h"
15 #include "ui/gfx/overlay_transform.h"
16 #include "ui/gfx/transform.h"
18 namespace gfx {
19 class Rect;
22 namespace cc {
24 class CC_EXPORT OverlayCandidate {
25 public:
26 static gfx::OverlayTransform GetOverlayTransform(
27 const gfx::Transform& quad_transform,
28 bool y_flipped);
29 // Apply transform |delta| to |in| and return the resulting transform,
30 // or OVERLAY_TRANSFORM_INVALID.
31 static gfx::OverlayTransform ModifyTransform(gfx::OverlayTransform in,
32 gfx::OverlayTransform delta);
33 static gfx::RectF GetOverlayRect(const gfx::Transform& quad_transform,
34 const gfx::Rect& rect);
36 OverlayCandidate();
37 ~OverlayCandidate();
39 // Transformation to apply to layer during composition.
40 gfx::OverlayTransform transform;
41 // Format of the buffer to composite.
42 ResourceFormat format;
43 // Size of the resource, in pixels.
44 gfx::Size resource_size_in_pixels;
45 // Rect on the display to position the overlay to. Implementer must convert
46 // to integer coordinates if setting |overlay_handled| to true.
47 gfx::RectF display_rect;
48 // Crop within the buffer to be placed inside |display_rect|.
49 gfx::RectF uv_rect;
50 // Quad geometry rect after applying the quad_transform().
51 gfx::Rect quad_rect_in_target_space;
52 // Clip rect in the target content space after composition.
53 gfx::Rect clip_rect;
54 // If the quad is clipped after composition.
55 bool is_clipped;
56 // True if the texture for this overlay should be the same one used by the
57 // output surface's main overlay.
58 bool use_output_surface_for_resource;
59 // Texture resource to present in an overlay.
60 unsigned resource_id;
61 // Stacking order of the overlay plane relative to the main surface,
62 // which is 0. Signed to allow for "underlays".
63 int plane_z_order;
65 // To be modified by the implementer if this candidate can go into
66 // an overlay.
67 bool overlay_handled;
70 typedef std::vector<OverlayCandidate> OverlayCandidateList;
72 } // namespace cc
74 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_