Landing Recent QUIC changes until 8/19/2015 17:00 UTC.
[chromium-blink-merge.git] / cc / output / overlay_candidate.h
blob4ca80b3f2732dd21b42802bed1cc429f52c6a2ba
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 y_flipped);
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);
30 OverlayCandidate();
31 ~OverlayCandidate();
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|.
43 gfx::RectF uv_rect;
44 // True if the texture for this overlay should be the same one used by the
45 // output surface's main overlay.
46 bool use_output_surface_for_resource;
47 // Texture resource to present in an overlay.
48 unsigned resource_id;
49 // Stacking order of the overlay plane relative to the main surface,
50 // which is 0. Signed to allow for "underlays".
51 int plane_z_order;
53 // To be modified by the implementer if this candidate can go into
54 // an overlay.
55 bool overlay_handled;
58 typedef std::vector<OverlayCandidate> OverlayCandidateList;
60 } // namespace cc
62 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_