Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: cc/output/overlay_candidate.h

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/ipc/transferable_resource_struct_traits.cc ('k') | cc/output/overlay_candidate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_OVERLAY_CANDIDATE_H_ 5 #ifndef CC_OUTPUT_OVERLAY_CANDIDATE_H_
6 #define CC_OUTPUT_OVERLAY_CANDIDATE_H_ 6 #define CC_OUTPUT_OVERLAY_CANDIDATE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
11 #include "cc/base/resource_id.h"
11 #include "cc/quads/render_pass.h" 12 #include "cc/quads/render_pass.h"
12 #include "cc/resources/resource_format.h" 13 #include "cc/resources/resource_format.h"
13 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/geometry/rect_f.h" 15 #include "ui/gfx/geometry/rect_f.h"
15 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/overlay_transform.h" 17 #include "ui/gfx/overlay_transform.h"
17 #include "ui/gfx/transform.h" 18 #include "ui/gfx/transform.h"
18 19
19 namespace gfx { 20 namespace gfx {
20 class Rect; 21 class Rect;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 gfx::Rect quad_rect_in_target_space; 64 gfx::Rect quad_rect_in_target_space;
64 // Clip rect in the target content space after composition. 65 // Clip rect in the target content space after composition.
65 gfx::Rect clip_rect; 66 gfx::Rect clip_rect;
66 // If the quad is clipped after composition. 67 // If the quad is clipped after composition.
67 bool is_clipped; 68 bool is_clipped;
68 // True if the texture for this overlay should be the same one used by the 69 // True if the texture for this overlay should be the same one used by the
69 // output surface's main overlay. 70 // output surface's main overlay.
70 bool use_output_surface_for_resource; 71 bool use_output_surface_for_resource;
71 // Texture resource to present in an overlay. 72 // Texture resource to present in an overlay.
72 unsigned resource_id; 73 unsigned resource_id;
74
75 #if defined(OS_ANDROID)
76 // For candidates from StreamVideoDrawQuads, this records whether the quad is
77 // marked as being backed by a SurfaceTexture or not. If so, it's not really
78 // promotable to an overlay.
79 bool is_backed_by_surface_texture;
80
81 // Filled in by the OverlayCandidateValidator to indicate whether this is a
82 // promotable candidate or not.
83 bool is_promotable_hint;
84 #endif
85
73 // Stacking order of the overlay plane relative to the main surface, 86 // Stacking order of the overlay plane relative to the main surface,
74 // which is 0. Signed to allow for "underlays". 87 // which is 0. Signed to allow for "underlays".
75 int plane_z_order; 88 int plane_z_order;
76 // True if the overlay does not have any visible quads on top of it. Set by 89 // True if the overlay does not have any visible quads on top of it. Set by
77 // the strategy so the OverlayProcessor can consider subtracting damage caused 90 // the strategy so the OverlayProcessor can consider subtracting damage caused
78 // by underlay quads. 91 // by underlay quads.
79 bool is_unoccluded; 92 bool is_unoccluded;
80 93
81 // To be modified by the implementer if this candidate can go into 94 // To be modified by the implementer if this candidate can go into
82 // an overlay. 95 // an overlay.
83 bool overlay_handled; 96 bool overlay_handled;
84 97
85 private: 98 private:
86 static bool FromTextureQuad(ResourceProvider* resource_provider, 99 static bool FromTextureQuad(ResourceProvider* resource_provider,
87 const TextureDrawQuad* quad, 100 const TextureDrawQuad* quad,
88 OverlayCandidate* candidate); 101 OverlayCandidate* candidate);
89 static bool FromStreamVideoQuad(ResourceProvider* resource_provider, 102 static bool FromStreamVideoQuad(ResourceProvider* resource_provider,
90 const StreamVideoDrawQuad* quad, 103 const StreamVideoDrawQuad* quad,
91 OverlayCandidate* candidate); 104 OverlayCandidate* candidate);
92 }; 105 };
93 106
94 typedef std::vector<OverlayCandidate> OverlayCandidateList; 107 class CC_EXPORT OverlayCandidateList : public std::vector<OverlayCandidate> {
108 public:
109 OverlayCandidateList();
110 OverlayCandidateList(const OverlayCandidateList&);
111 OverlayCandidateList(OverlayCandidateList&&);
112 ~OverlayCandidateList();
113
114 OverlayCandidateList& operator=(const OverlayCandidateList&);
115 OverlayCandidateList& operator=(OverlayCandidateList&&);
116
117 // For android, this provides a set of resources that could be promoted to
118 // overlay, if one backs them with a SurfaceView.
119 ResourceIdSet promotable_resource_hints_;
120 };
95 121
96 } // namespace cc 122 } // namespace cc
97 123
98 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ 124 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_
OLDNEW
« no previous file with comments | « cc/ipc/transferable_resource_struct_traits.cc ('k') | cc/output/overlay_candidate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698