Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 OverlayCandidateList : public std::vector<OverlayCandidate> { |
| 108 public: | |
| 109 OverlayCandidateList(); | |
| 110 OverlayCandidateList(const OverlayCandidateList&); | |
|
piman
2016/12/01 21:55:25
nit: rule-of-3? (i.e. add a copy-assignment operat
liberato (no reviews please)
2016/12/05 18:14:01
Done.
| |
| 111 ~OverlayCandidateList(); | |
| 112 | |
| 113 // For android, this provides a set of resources that could be promoted to | |
| 114 // overlay, if one backs them with a SurfaceView. | |
| 115 ResourceIdSet promotable_resource_hints_; | |
| 116 }; | |
| 95 | 117 |
| 96 } // namespace cc | 118 } // namespace cc |
| 97 | 119 |
| 98 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ | 120 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ |
| OLD | NEW |