| 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/quads/render_pass.h" | 11 #include "cc/quads/render_pass.h" |
| 12 #include "cc/resources/resource_format.h" | 12 #include "cc/resources/resource_format.h" |
| 13 #include "ui/gfx/buffer_types.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; |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 QuadList::ConstIterator quad_list_begin, | 46 QuadList::ConstIterator quad_list_begin, |
| 46 QuadList::ConstIterator quad_list_end); | 47 QuadList::ConstIterator quad_list_end); |
| 47 | 48 |
| 48 OverlayCandidate(); | 49 OverlayCandidate(); |
| 49 ~OverlayCandidate(); | 50 ~OverlayCandidate(); |
| 50 | 51 |
| 51 // Transformation to apply to layer during composition. | 52 // Transformation to apply to layer during composition. |
| 52 gfx::OverlayTransform transform; | 53 gfx::OverlayTransform transform; |
| 53 // Format of the buffer to composite. | 54 // Format of the buffer to composite. |
| 54 ResourceFormat format; | 55 ResourceFormat format; |
| 56 // Optimal storage format supported by the platform for this candidate. |
| 57 gfx::BufferFormat storage_format; |
| 55 // Size of the resource, in pixels. | 58 // Size of the resource, in pixels. |
| 56 gfx::Size resource_size_in_pixels; | 59 gfx::Size resource_size_in_pixels; |
| 57 // Rect on the display to position the overlay to. Implementer must convert | 60 // Rect on the display to position the overlay to. Implementer must convert |
| 58 // to integer coordinates if setting |overlay_handled| to true. | 61 // to integer coordinates if setting |overlay_handled| to true. |
| 59 gfx::RectF display_rect; | 62 gfx::RectF display_rect; |
| 60 // Crop within the buffer to be placed inside |display_rect|. | 63 // Crop within the buffer to be placed inside |display_rect|. |
| 61 gfx::RectF uv_rect; | 64 gfx::RectF uv_rect; |
| 62 // Quad geometry rect after applying the quad_transform(). | 65 // Quad geometry rect after applying the quad_transform(). |
| 63 gfx::Rect quad_rect_in_target_space; | 66 gfx::Rect quad_rect_in_target_space; |
| 64 // Clip rect in the target content space after composition. | 67 // Clip rect in the target content space after composition. |
| 65 gfx::Rect clip_rect; | 68 gfx::Rect clip_rect; |
| 66 // If the quad is clipped after composition. | 69 // If the quad is clipped after composition. |
| 67 bool is_clipped; | 70 bool is_clipped; |
| 68 // True if the texture for this overlay should be the same one used by the | 71 // True if the texture for this overlay should be the same one used by the |
| 69 // output surface's main overlay. | 72 // output surface's main overlay. |
| 70 bool use_output_surface_for_resource; | 73 bool use_output_surface_for_resource; |
| 71 // Texture resource to present in an overlay. | 74 // Texture resource to present in an overlay. |
| 72 unsigned resource_id; | 75 unsigned resource_id; |
| 73 // Stacking order of the overlay plane relative to the main surface, | 76 // Stacking order of the overlay plane relative to the main surface, |
| 74 // which is 0. Signed to allow for "underlays". | 77 // which is 0. Signed to allow for "underlays". |
| 75 int plane_z_order; | 78 int plane_z_order; |
| 76 // True if the overlay does not have any visible quads on top of it. Set by | 79 // 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 | 80 // the strategy so the OverlayProcessor can consider subtracting damage caused |
| 78 // by underlay quads. | 81 // by underlay quads. |
| 79 bool is_unoccluded; | 82 bool is_unoccluded; |
| 83 // True if any required scaling needs to be handled before composition. |
| 84 bool handle_scaling; |
| 80 | 85 |
| 81 // To be modified by the implementer if this candidate can go into | 86 // To be modified by the implementer if this candidate can go into |
| 82 // an overlay. | 87 // an overlay. |
| 83 bool overlay_handled; | 88 bool overlay_handled; |
| 84 | 89 |
| 85 private: | 90 private: |
| 86 static bool FromTextureQuad(ResourceProvider* resource_provider, | 91 static bool FromTextureQuad(ResourceProvider* resource_provider, |
| 87 const TextureDrawQuad* quad, | 92 const TextureDrawQuad* quad, |
| 88 OverlayCandidate* candidate); | 93 OverlayCandidate* candidate); |
| 89 static bool FromStreamVideoQuad(ResourceProvider* resource_provider, | 94 static bool FromStreamVideoQuad(ResourceProvider* resource_provider, |
| 90 const StreamVideoDrawQuad* quad, | 95 const StreamVideoDrawQuad* quad, |
| 91 OverlayCandidate* candidate); | 96 OverlayCandidate* candidate); |
| 92 static bool FromIOSurfaceQuad(ResourceProvider* resource_provider, | 97 static bool FromIOSurfaceQuad(ResourceProvider* resource_provider, |
| 93 const IOSurfaceDrawQuad* quad, | 98 const IOSurfaceDrawQuad* quad, |
| 94 OverlayCandidate* candidate); | 99 OverlayCandidate* candidate); |
| 95 }; | 100 }; |
| 96 | 101 |
| 97 typedef std::vector<OverlayCandidate> OverlayCandidateList; | 102 typedef std::vector<OverlayCandidate> OverlayCandidateList; |
| 98 | 103 |
| 99 } // namespace cc | 104 } // namespace cc |
| 100 | 105 |
| 101 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ | 106 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ |
| OLD | NEW |