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

Side by Side Diff: cc/quads/draw_polygon.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 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 unified diff | Download patch
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/quads/render_pass_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "cc/quads/draw_polygon.h" 5 #include "cc/quads/draw_polygon.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/output/bsp_compare_result.h" 9 #include "cc/output/bsp_compare_result.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 for (int i = 0; i < num_vertices_in_clipped_quad; i++) { 69 for (int i = 0; i < num_vertices_in_clipped_quad; i++) {
70 points_.push_back(points[i]); 70 points_.push_back(points[i]);
71 } 71 }
72 ApplyTransformToNormal(transform); 72 ApplyTransformToNormal(transform);
73 } 73 }
74 74
75 DrawPolygon::~DrawPolygon() { 75 DrawPolygon::~DrawPolygon() {
76 } 76 }
77 77
78 scoped_ptr<DrawPolygon> DrawPolygon::CreateCopy() { 78 scoped_ptr<DrawPolygon> DrawPolygon::CreateCopy() {
79 DrawPolygon* new_polygon = new DrawPolygon(); 79 scoped_ptr<DrawPolygon> new_polygon(new DrawPolygon());
80 new_polygon->order_index_ = order_index_; 80 new_polygon->order_index_ = order_index_;
81 new_polygon->original_ref_ = original_ref_; 81 new_polygon->original_ref_ = original_ref_;
82 new_polygon->points_.reserve(points_.size()); 82 new_polygon->points_.reserve(points_.size());
83 new_polygon->points_ = points_; 83 new_polygon->points_ = points_;
84 new_polygon->normal_.set_x(normal_.x()); 84 new_polygon->normal_.set_x(normal_.x());
85 new_polygon->normal_.set_y(normal_.y()); 85 new_polygon->normal_.set_y(normal_.y());
86 new_polygon->normal_.set_z(normal_.z()); 86 new_polygon->normal_.set_z(normal_.z());
87 return scoped_ptr<DrawPolygon>(new_polygon); 87 return new_polygon.Pass();
88 } 88 }
89 89
90 float DrawPolygon::SignedPointDistance(const gfx::Point3F& point) const { 90 float DrawPolygon::SignedPointDistance(const gfx::Point3F& point) const {
91 return gfx::DotProduct(point - points_[0], normal_); 91 return gfx::DotProduct(point - points_[0], normal_);
92 } 92 }
93 93
94 // Checks whether or not shape a lies on the front or back side of b, or 94 // Checks whether or not shape a lies on the front or back side of b, or
95 // whether they should be considered coplanar. If on the back side, we 95 // whether they should be considered coplanar. If on the back side, we
96 // say ABeforeB because it should be drawn in that order. 96 // say ABeforeB because it should be drawn in that order.
97 // Assumes that layers are split and there are no intersecting planes. 97 // Assumes that layers are split and there are no intersecting planes.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 quads->push_back( 343 quads->push_back(
344 gfx::QuadF(first, 344 gfx::QuadF(first,
345 gfx::PointF(points_[offset].x(), points_[offset].y()), 345 gfx::PointF(points_[offset].x(), points_[offset].y()),
346 gfx::PointF(points_[op1].x(), points_[op1].y()), 346 gfx::PointF(points_[op1].x(), points_[op1].y()),
347 gfx::PointF(points_[op2].x(), points_[op2].y()))); 347 gfx::PointF(points_[op2].x(), points_[op2].y())));
348 offset = op2; 348 offset = op2;
349 } 349 }
350 } 350 }
351 351
352 } // namespace cc 352 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/quads/render_pass_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698