OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_Y_VIDEO_DRAW_QUAD_H_ |
6 #define CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ | 6 #define CC_QUADS_Y_VIDEO_DRAW_QUAD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 #include "cc/quads/draw_quad.h" | 13 #include "cc/quads/draw_quad.h" |
14 #include "ui/gfx/transform.h" | 14 #include "ui/gfx/geometry/rect_f.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { | 18 class CC_EXPORT YVideoDrawQuad : public DrawQuad { |
19 public: | 19 public: |
20 static const size_t kResourceIdIndex = 0; | 20 static const size_t kResourceIdIndex = 0; |
21 | 21 |
22 StreamVideoDrawQuad(); | 22 YVideoDrawQuad(); |
| 23 YVideoDrawQuad(const YVideoDrawQuad& other); |
23 | 24 |
24 void SetNew(const SharedQuadState* shared_quad_state, | 25 void SetNew(const SharedQuadState* shared_quad_state, |
25 const gfx::Rect& rect, | 26 const gfx::Rect& rect, |
26 const gfx::Rect& opaque_rect, | 27 const gfx::Rect& opaque_rect, |
27 const gfx::Rect& visible_rect, | 28 const gfx::Rect& visible_rect, |
28 unsigned resource_id, | 29 unsigned resource_id, |
29 gfx::Size resource_size_in_pixels, | 30 const gfx::PointF& uv_top_left, |
30 const gfx::Transform& matrix); | 31 const gfx::PointF& uv_bottom_right); |
31 | 32 |
32 void SetAll(const SharedQuadState* shared_quad_state, | 33 void SetAll(const SharedQuadState* shared_quad_state, |
33 const gfx::Rect& rect, | 34 const gfx::Rect& rect, |
34 const gfx::Rect& opaque_rect, | 35 const gfx::Rect& opaque_rect, |
35 const gfx::Rect& visible_rect, | 36 const gfx::Rect& visible_rect, |
36 bool needs_blending, | |
37 unsigned resource_id, | 37 unsigned resource_id, |
38 gfx::Size resource_size_in_pixels, | 38 gfx::Size resource_size_in_pixels, |
39 const gfx::Transform& matrix); | 39 const gfx::PointF& uv_top_left, |
| 40 const gfx::PointF& uv_bottom_right); |
40 | 41 |
41 gfx::Transform matrix; | 42 gfx::PointF uv_top_left; |
42 | 43 gfx::PointF uv_bottom_right; |
43 struct OverlayResources { | |
44 OverlayResources(); | |
45 gfx::Size size_in_pixels[Resources::kMaxResourceIdCount]; | |
46 }; | |
47 OverlayResources overlay_resources; | |
48 | |
49 static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); | |
50 | 44 |
51 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } | 45 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } |
52 const gfx::Size& resource_size_in_pixels() const { | 46 static const YVideoDrawQuad* MaterialCast(const DrawQuad*); |
53 return overlay_resources.size_in_pixels[kResourceIdIndex]; | |
54 } | |
55 | 47 |
56 private: | 48 private: |
57 void ExtendValue(base::trace_event::TracedValue* value) const override; | 49 void ExtendValue(base::trace_event::TracedValue* value) const override; |
58 }; | 50 }; |
59 | 51 |
60 } // namespace cc | 52 } // namespace cc |
61 | 53 |
62 #endif // CC_QUADS_STREAM_VIDEO_DRAW_QUAD_H_ | 54 #endif // CC_QUADS_Y_VIDEO_DRAW_QUAD_H_ |
OLD | NEW |