API migration: picture.draw -> picture.playback
[chromium-blink-merge.git] / cc / output / overlay_candidate.h
blob9a1e534e5f23591c9812fb8d28746b67e12ed7bb
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/overlay_transform.h"
14 #include "ui/gfx/transform.h"
16 namespace cc {
18 class CC_EXPORT OverlayCandidate {
19 public:
20 static gfx::OverlayTransform GetOverlayTransform(
21 const gfx::Transform& quad_transform,
22 bool flipped);
23 static gfx::Rect GetOverlayRect(const gfx::Transform& quad_transform,
24 const gfx::Rect& rect);
26 OverlayCandidate();
27 ~OverlayCandidate();
29 // Transformation to apply to layer during composition.
30 gfx::OverlayTransform transform;
31 // Format of the buffer to composite.
32 ResourceFormat format;
33 // Rect on the display to position the overlay to.
34 gfx::Rect display_rect;
35 // Crop within the buffer to be placed inside |display_rect|.
36 gfx::RectF uv_rect;
37 // Texture resource to present in an overlay.
38 unsigned resource_id;
39 // Stacking order of the overlay plane relative to the main surface,
40 // which is 0. Signed to allow for "underlays".
41 int plane_z_order;
43 // To be modified by the implementer if this candidate can go into
44 // an overlay.
45 bool overlay_handled;
48 typedef std::vector<OverlayCandidate> OverlayCandidateList;
50 } // namespace cc
52 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_