Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: cc/quads/y_video_draw_quad.h

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 StreamVideoDrawQuad(); 20 static const size_t kResourceIdIndex = 0;
21
22 YVideoDrawQuad();
23 YVideoDrawQuad(const YVideoDrawQuad& other);
21 24
22 void SetNew(const SharedQuadState* shared_quad_state, 25 void SetNew(const SharedQuadState* shared_quad_state,
23 const gfx::Rect& rect, 26 const gfx::Rect& rect,
24 const gfx::Rect& opaque_rect, 27 const gfx::Rect& opaque_rect,
25 const gfx::Rect& visible_rect, 28 const gfx::Rect& visible_rect,
26 unsigned resource_id, 29 unsigned resource_id,
27 gfx::Size resource_size_in_pixels, 30 const gfx::PointF& uv_top_left,
28 const gfx::Transform& matrix); 31 const gfx::PointF& uv_bottom_right);
29 32
30 void SetAll(const SharedQuadState* shared_quad_state, 33 void SetAll(const SharedQuadState* shared_quad_state,
31 const gfx::Rect& rect, 34 const gfx::Rect& rect,
32 const gfx::Rect& opaque_rect, 35 const gfx::Rect& opaque_rect,
33 const gfx::Rect& visible_rect, 36 const gfx::Rect& visible_rect,
34 bool needs_blending,
35 unsigned resource_id, 37 unsigned resource_id,
36 gfx::Size resource_size_in_pixels, 38 gfx::Size resource_size_in_pixels,
37 const gfx::Transform& matrix); 39 const gfx::PointF& uv_top_left,
40 const gfx::PointF& uv_bottom_right);
38 41
39 gfx::Transform matrix; 42 gfx::PointF uv_top_left;
40 43 gfx::PointF uv_bottom_right;
41 struct OverlayResources {
42 OverlayResources();
43 gfx::Size size_in_pixels[Resources::kMaxResourceIdCount];
44 };
45 OverlayResources overlay_resources;
46
47 static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*);
48 44
49 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } 45 ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; }
50 const gfx::Size& resource_size_in_pixels() const { 46 static const YVideoDrawQuad* MaterialCast(const DrawQuad*);
51 return overlay_resources.size_in_pixels[kResourceIdIndex];
52 }
53 47
54 private: 48 private:
55 static const size_t kResourceIdIndex = 0;
56
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698