| 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/resources/resource_format.h" | 11 #include "cc/resources/resource_format.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/gfx/overlay_transform.h" | 15 #include "ui/gfx/overlay_transform.h" |
| 16 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Rect; | 19 class Rect; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 class DrawQuad; | 24 class DrawQuad; |
| 25 class IOSurfaceDrawQuad; | 25 class IOSurfaceDrawQuad; |
| 26 class SolidColorDrawQuad; |
| 26 class StreamVideoDrawQuad; | 27 class StreamVideoDrawQuad; |
| 27 class TextureDrawQuad; | 28 class TextureDrawQuad; |
| 29 class TileDrawQuad; |
| 28 | 30 |
| 29 class CC_EXPORT OverlayCandidate { | 31 class CC_EXPORT OverlayCandidate { |
| 30 public: | 32 public: |
| 33 // Returns true if |quad| might contain video. |
| 34 static bool IsVideoQuad(const DrawQuad* quad); |
| 31 // Returns true and fills in |candidate| if |draw_quad| is of a known quad | 35 // Returns true and fills in |candidate| if |draw_quad| is of a known quad |
| 32 // type and contains an overlayable resource. | 36 // type and contains an overlayable resource. |
| 33 static bool FromDrawQuad(const DrawQuad* quad, OverlayCandidate* candidate); | 37 static bool FromDrawQuad(const DrawQuad* quad, OverlayCandidate* candidate); |
| 34 // Returns true if |quad| will not block quads underneath from becoming | 38 // Returns true if |quad| will not block quads underneath from becoming |
| 35 // an overlay. | 39 // an overlay. |
| 36 static bool IsInvisibleQuad(const DrawQuad* quad); | 40 static bool IsInvisibleQuad(const DrawQuad* quad); |
| 37 | 41 |
| 38 OverlayCandidate(); | 42 OverlayCandidate(); |
| 39 ~OverlayCandidate(); | 43 ~OverlayCandidate(); |
| 40 | 44 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 gfx::Rect quad_rect_in_target_space; | 57 gfx::Rect quad_rect_in_target_space; |
| 54 // Clip rect in the target content space after composition. | 58 // Clip rect in the target content space after composition. |
| 55 gfx::Rect clip_rect; | 59 gfx::Rect clip_rect; |
| 56 // If the quad is clipped after composition. | 60 // If the quad is clipped after composition. |
| 57 bool is_clipped; | 61 bool is_clipped; |
| 58 // True if the texture for this overlay should be the same one used by the | 62 // True if the texture for this overlay should be the same one used by the |
| 59 // output surface's main overlay. | 63 // output surface's main overlay. |
| 60 bool use_output_surface_for_resource; | 64 bool use_output_surface_for_resource; |
| 61 // Texture resource to present in an overlay. | 65 // Texture resource to present in an overlay. |
| 62 unsigned resource_id; | 66 unsigned resource_id; |
| 67 // If |resource_id| is 0, this overlay is solid color. |
| 68 SkColor solid_color; |
| 63 // Stacking order of the overlay plane relative to the main surface, | 69 // Stacking order of the overlay plane relative to the main surface, |
| 64 // which is 0. Signed to allow for "underlays". | 70 // which is 0. Signed to allow for "underlays". |
| 65 int plane_z_order; | 71 int plane_z_order; |
| 66 | 72 |
| 67 // To be modified by the implementer if this candidate can go into | 73 // To be modified by the implementer if this candidate can go into |
| 68 // an overlay. | 74 // an overlay. |
| 69 bool overlay_handled; | 75 bool overlay_handled; |
| 70 | 76 |
| 71 private: | 77 private: |
| 72 static bool FromTextureQuad(const TextureDrawQuad* quad, | 78 static bool FromTextureQuad(const TextureDrawQuad* quad, |
| 73 OverlayCandidate* candidate); | 79 OverlayCandidate* candidate); |
| 74 static bool FromStreamVideoQuad(const StreamVideoDrawQuad* quad, | 80 static bool FromStreamVideoQuad(const StreamVideoDrawQuad* quad, |
| 75 OverlayCandidate* candidate); | 81 OverlayCandidate* candidate); |
| 76 static bool FromIOSurfaceQuad(const IOSurfaceDrawQuad* quad, | 82 static bool FromIOSurfaceQuad(const IOSurfaceDrawQuad* quad, |
| 77 OverlayCandidate* candidate); | 83 OverlayCandidate* candidate); |
| 84 static bool FromTileQuad(const TileDrawQuad* quad, |
| 85 OverlayCandidate* candidate); |
| 86 static bool FromSolidColorQuad(const SolidColorDrawQuad* quad, |
| 87 OverlayCandidate* candidate); |
| 78 }; | 88 }; |
| 79 | 89 |
| 80 typedef std::vector<OverlayCandidate> OverlayCandidateList; | 90 typedef std::vector<OverlayCandidate> OverlayCandidateList; |
| 81 | 91 |
| 82 } // namespace cc | 92 } // namespace cc |
| 83 | 93 |
| 84 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ | 94 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ |
| OLD | NEW |