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/overlay_transform.h"
14 #include "ui/gfx/transform.h"
18 class CC_EXPORT OverlayCandidate
{
20 static gfx::OverlayTransform
GetOverlayTransform(
21 const gfx::Transform
& quad_transform
,
23 // Apply transform |delta| to |in| and return the resulting transform,
24 // or OVERLAY_TRANSFORM_INVALID.
25 static gfx::OverlayTransform
ModifyTransform(gfx::OverlayTransform in
,
26 gfx::OverlayTransform delta
);
27 static gfx::Rect
GetOverlayRect(const gfx::Transform
& quad_transform
,
28 const gfx::Rect
& rect
);
33 // Transformation to apply to layer during composition.
34 gfx::OverlayTransform transform
;
35 // Format of the buffer to composite.
36 ResourceFormat format
;
37 // Rect on the display to position the overlay to.
38 gfx::Rect display_rect
;
39 // Crop within the buffer to be placed inside |display_rect|.
41 // Texture resource to present in an overlay.
43 // Stacking order of the overlay plane relative to the main surface,
44 // which is 0. Signed to allow for "underlays".
47 // To be modified by the implementer if this candidate can go into
52 typedef std::vector
<OverlayCandidate
> OverlayCandidateList
;
56 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_