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::RectF
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 // Size of the resource, in pixels.
38 gfx::Size resource_size_in_pixels
;
39 // Rect on the display to position the overlay to. Implementer must convert
40 // to integer coordinates if setting |overlay_handled| to true.
41 gfx::RectF display_rect
;
42 // Crop within the buffer to be placed inside |display_rect|.
44 // Texture resource to present in an overlay.
46 // Stacking order of the overlay plane relative to the main surface,
47 // which is 0. Signed to allow for "underlays".
50 // To be modified by the implementer if this candidate can go into
55 typedef std::vector
<OverlayCandidate
> OverlayCandidateList
;
59 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_