GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / cc / output / overlay_candidate.h
blob28ae8cb73d35897979db66e61e3ac5bd720069a8
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 // 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);
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 // 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|.
40 gfx::RectF uv_rect;
41 // Texture resource to present in an overlay.
42 unsigned resource_id;
43 // Stacking order of the overlay plane relative to the main surface,
44 // which is 0. Signed to allow for "underlays".
45 int plane_z_order;
47 // To be modified by the implementer if this candidate can go into
48 // an overlay.
49 bool overlay_handled;
52 typedef std::vector<OverlayCandidate> OverlayCandidateList;
54 } // namespace cc
56 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_