| 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 StreamVideoDrawQuad; | 26 class StreamVideoDrawQuad; |
| 27 class TextureDrawQuad; | 27 class TextureDrawQuad; |
| 28 class ResourceProvider; |
| 28 | 29 |
| 29 class CC_EXPORT OverlayCandidate { | 30 class CC_EXPORT OverlayCandidate { |
| 30 public: | 31 public: |
| 31 // Returns true and fills in |candidate| if |draw_quad| is of a known quad | 32 // Returns true and fills in |candidate| if |draw_quad| is of a known quad |
| 32 // type and contains an overlayable resource. | 33 // type and contains an overlayable resource. |
| 33 static bool FromDrawQuad(const DrawQuad* quad, OverlayCandidate* candidate); | 34 static bool FromDrawQuad(ResourceProvider* resource_provider, |
| 35 const DrawQuad* quad, |
| 36 OverlayCandidate* candidate); |
| 34 // Returns true if |quad| will not block quads underneath from becoming | 37 // Returns true if |quad| will not block quads underneath from becoming |
| 35 // an overlay. | 38 // an overlay. |
| 36 static bool IsInvisibleQuad(const DrawQuad* quad); | 39 static bool IsInvisibleQuad(const DrawQuad* quad); |
| 37 | 40 |
| 38 OverlayCandidate(); | 41 OverlayCandidate(); |
| 39 ~OverlayCandidate(); | 42 ~OverlayCandidate(); |
| 40 | 43 |
| 41 // Transformation to apply to layer during composition. | 44 // Transformation to apply to layer during composition. |
| 42 gfx::OverlayTransform transform; | 45 gfx::OverlayTransform transform; |
| 43 // Format of the buffer to composite. | 46 // Format of the buffer to composite. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 62 unsigned resource_id; | 65 unsigned resource_id; |
| 63 // Stacking order of the overlay plane relative to the main surface, | 66 // Stacking order of the overlay plane relative to the main surface, |
| 64 // which is 0. Signed to allow for "underlays". | 67 // which is 0. Signed to allow for "underlays". |
| 65 int plane_z_order; | 68 int plane_z_order; |
| 66 | 69 |
| 67 // To be modified by the implementer if this candidate can go into | 70 // To be modified by the implementer if this candidate can go into |
| 68 // an overlay. | 71 // an overlay. |
| 69 bool overlay_handled; | 72 bool overlay_handled; |
| 70 | 73 |
| 71 private: | 74 private: |
| 72 static bool FromTextureQuad(const TextureDrawQuad* quad, | 75 static bool FromTextureQuad(ResourceProvider* resource_provider, |
| 76 const TextureDrawQuad* quad, |
| 73 OverlayCandidate* candidate); | 77 OverlayCandidate* candidate); |
| 74 static bool FromStreamVideoQuad(const StreamVideoDrawQuad* quad, | 78 static bool FromStreamVideoQuad(ResourceProvider* resource_provider, |
| 79 const StreamVideoDrawQuad* quad, |
| 75 OverlayCandidate* candidate); | 80 OverlayCandidate* candidate); |
| 76 static bool FromIOSurfaceQuad(const IOSurfaceDrawQuad* quad, | 81 static bool FromIOSurfaceQuad(ResourceProvider* resource_provider, |
| 82 const IOSurfaceDrawQuad* quad, |
| 77 OverlayCandidate* candidate); | 83 OverlayCandidate* candidate); |
| 78 }; | 84 }; |
| 79 | 85 |
| 80 typedef std::vector<OverlayCandidate> OverlayCandidateList; | 86 typedef std::vector<OverlayCandidate> OverlayCandidateList; |
| 81 | 87 |
| 82 } // namespace cc | 88 } // namespace cc |
| 83 | 89 |
| 84 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ | 90 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_H_ |
| OLD | NEW |