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

Unified Diff: cc/ipc/quads_struct_traits.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: rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/ipc/quads.mojom ('k') | cc/ipc/quads_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/quads_struct_traits.h
diff --git a/cc/ipc/quads_struct_traits.h b/cc/ipc/quads_struct_traits.h
index 06fd68c20d7aea6a86c1451bfeff1d7434d0a5d1..6a31f9a080b0008eca63b2e90dcdbcdbc1c245c1 100644
--- a/cc/ipc/quads_struct_traits.h
+++ b/cc/ipc/quads_struct_traits.h
@@ -19,6 +19,7 @@
#include "cc/quads/surface_draw_quad.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
+#include "cc/quads/y_video_draw_quad.h"
#include "cc/quads/yuv_video_draw_quad.h"
#include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
@@ -53,6 +54,8 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> {
return cc::mojom::DrawQuadStateDataView::Tag::TILE_QUAD_STATE;
case cc::DrawQuad::YUV_VIDEO_CONTENT:
return cc::mojom::DrawQuadStateDataView::Tag::YUV_VIDEO_QUAD_STATE;
+ case cc::DrawQuad::Y_VIDEO_CONTENT:
+ return cc::mojom::DrawQuadStateDataView::Tag::Y_VIDEO_QUAD_STATE;
}
NOTREACHED();
return cc::mojom::DrawQuadStateDataView::Tag::DEBUG_BORDER_QUAD_STATE;
@@ -90,6 +93,10 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> {
return quad;
}
+ static const cc::DrawQuad& y_video_quad_state(const cc::DrawQuad& quad) {
+ return quad;
+ }
+
static bool Read(cc::mojom::DrawQuadStateDataView data, cc::DrawQuad* out) {
switch (data.tag()) {
case cc::mojom::DrawQuadStateDataView::Tag::DEBUG_BORDER_QUAD_STATE:
@@ -108,6 +115,8 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> {
return data.ReadStreamVideoQuadState(out);
case cc::mojom::DrawQuadStateDataView::Tag::YUV_VIDEO_QUAD_STATE:
return data.ReadYuvVideoQuadState(out);
+ case cc::mojom::DrawQuadStateDataView::Tag::Y_VIDEO_QUAD_STATE:
+ return data.ReadYVideoQuadState(out);
}
NOTREACHED();
return false;
@@ -407,6 +416,26 @@ struct StructTraits<cc::mojom::YUVVideoQuadStateDataView, cc::DrawQuad> {
cc::DrawQuad* out);
};
+template <>
+struct StructTraits<cc::mojom::YVideoQuadStateDataView, cc::DrawQuad> {
+ static uint32_t resource_id(const cc::DrawQuad& input) {
+ const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
+ return quad->resource_id();
+ }
+
+ static const gfx::PointF& uv_top_left(const cc::DrawQuad& input) {
+ const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
+ return quad->uv_top_left;
+ }
+
+ static const gfx::PointF& uv_bottom_right(const cc::DrawQuad& input) {
+ const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
+ return quad->uv_bottom_right;
+ }
+
+ static bool Read(cc::mojom::YVideoQuadStateDataView data, cc::DrawQuad* out);
+};
+
struct DrawQuadWithSharedQuadState {
const cc::DrawQuad* quad;
const cc::SharedQuadState* shared_quad_state;
« no previous file with comments | « cc/ipc/quads.mojom ('k') | cc/ipc/quads_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698