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_
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"
24 class CC_EXPORT OverlayCandidate
{
26 static gfx::OverlayTransform
GetOverlayTransform(
27 const gfx::Transform
& quad_transform
,
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
);
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|.
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.
54 // If the quad is clipped after composition.
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.
61 // Stacking order of the overlay plane relative to the main surface,
62 // which is 0. Signed to allow for "underlays".
65 // To be modified by the implementer if this candidate can go into
70 typedef std::vector
<OverlayCandidate
> OverlayCandidateList
;
74 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_