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

Unified Diff: cc/quads/y_video_draw_quad.cc

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/quads/y_video_draw_quad.h ('k') | cc/raster/raster_buffer_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/y_video_draw_quad.cc
diff --git a/cc/quads/y_video_draw_quad.cc b/cc/quads/y_video_draw_quad.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3b0f5008a97890432db8d43301dad88bf9f1aa4e
--- /dev/null
+++ b/cc/quads/y_video_draw_quad.cc
@@ -0,0 +1,63 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/quads/y_video_draw_quad.h"
+
+#include <stddef.h>
+
+#include "base/logging.h"
+#include "base/trace_event/trace_event_argument.h"
+#include "base/values.h"
+#include "cc/base/math_util.h"
+#include "ui/gfx/geometry/vector2d_f.h"
+
+namespace cc {
+
+YVideoDrawQuad::YVideoDrawQuad() {}
+
+YVideoDrawQuad::YVideoDrawQuad(const YVideoDrawQuad& other) = default;
+
+void YVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
+ const gfx::Rect& rect,
+ const gfx::Rect& opaque_rect,
+ const gfx::Rect& visible_rect,
+ unsigned resource_id,
+ const gfx::PointF& uv_top_left,
+ const gfx::PointF& uv_bottom_right) {
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::Y_VIDEO_CONTENT, rect,
+ opaque_rect, visible_rect, false);
+ resources.ids[kResourceIdIndex] = resource_id;
+ resources.count = 1;
+ this->uv_top_left = uv_top_left;
+ this->uv_bottom_right = uv_bottom_right;
+}
+
+void YVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
+ const gfx::Rect& rect,
+ const gfx::Rect& opaque_rect,
+ const gfx::Rect& visible_rect,
+ bool needs_blending,
+ unsigned resource_id,
+ const gfx::PointF& uv_top_left,
+ const gfx::PointF& uv_bottom_right) {
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::Y_VIDEO_CONTENT, rect,
+ opaque_rect, visible_rect, needs_blending);
+ resources.ids[kResourceIdIndex] = resource_id;
+ resources.count = 1;
+ this->uv_top_left = uv_top_left;
+ this->uv_bottom_right = uv_bottom_right;
+}
+
+const YVideoDrawQuad* YVideoDrawQuad::MaterialCast(const DrawQuad* quad) {
+ DCHECK(quad->material == DrawQuad::Y_VIDEO_CONTENT);
+ return static_cast<const YVideoDrawQuad*>(quad);
+}
+
+void YVideoDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const {
+ value->SetInteger("resource_id", resources.ids[kResourceIdIndex]);
+ MathUtil::AddToTracedValue("uv_top_left", uv_top_left, value);
+ MathUtil::AddToTracedValue("uv_bottom_right", uv_bottom_right, value);
+}
+
+} // namespace cc
« no previous file with comments | « cc/quads/y_video_draw_quad.h ('k') | cc/raster/raster_buffer_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698