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

Unified Diff: cc/quads/draw_polygon.cc

Issue 416273002: BSP Tree perf tests to match LayerSorter perf tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/quads/draw_polygon.cc
diff --git a/cc/quads/draw_polygon.cc b/cc/quads/draw_polygon.cc
index db2249c0ef5b86d75d28d51c6427fcdbeaaaa32e..f6fee567f3423c42a985f25e32c9fddb3a01a6b5 100644
--- a/cc/quads/draw_polygon.cc
+++ b/cc/quads/draw_polygon.cc
@@ -6,7 +6,9 @@
#include <vector>
+#include "cc/layers/layer_impl.h"
#include "cc/output/bsp_compare_result.h"
+#include "cc/quads/draw_quad.h"
namespace {
// This allows for some imperfection in the normal comparison when checking if
@@ -45,6 +47,25 @@ DrawPolygon::DrawPolygon(DrawQuad* original,
normal_ = normal;
}
+// This takes the original DrawQuad that this polygon should be based on,
+// a visible content rect to make the 4 corner points from, and a transformation
+// to move it and its normal into screen space.
+DrawPolygon::DrawPolygon(DrawQuad* original_ref,
+ const gfx::RectF& visible_content_rect,
+ const gfx::Transform& transform,
+ int draw_order_index)
+ : order_index_(draw_order_index), original_ref_(original_ref) {
enne (OOO) 2014/07/30 18:43:56 I think you need to set the normal to a default va
troyhildebrandt 2014/07/30 23:36:57 Done.
+ gfx::Point3F points[8];
+ int num_vertices_in_clipped_quad;
+ gfx::QuadF send_quad(visible_content_rect);
+ MathUtil::MapClippedQuad3d(
enne (OOO) 2014/07/30 18:43:56 Can you just make "gfx::QuadF quad(visible_content
troyhildebrandt 2014/07/30 23:36:57 I put a comment on it.
+ transform, send_quad, points, &num_vertices_in_clipped_quad);
+ for (int i = 0; i < num_vertices_in_clipped_quad; i++) {
+ points_.push_back(points[i]);
+ }
+ ApplyTransformToNormal(transform);
+}
+
DrawPolygon::~DrawPolygon() {
}

Powered by Google App Engine
This is Rietveld 408576698