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

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

Issue 1497153002: Replace inverse transform with Cross-product computation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved section and rebased again Created 5 years 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 | « no previous file | cc/quads/draw_polygon.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 #ifndef CC_QUADS_DRAW_POLYGON_H_ 5 #ifndef CC_QUADS_DRAW_POLYGON_H_
6 #define CC_QUADS_DRAW_POLYGON_H_ 6 #define CC_QUADS_DRAW_POLYGON_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void TransformToScreenSpace(const gfx::Transform& transform); 52 void TransformToScreenSpace(const gfx::Transform& transform);
53 void TransformToLayerSpace(const gfx::Transform& inverse_transform); 53 void TransformToLayerSpace(const gfx::Transform& inverse_transform);
54 54
55 const std::vector<gfx::Point3F>& points() const { return points_; } 55 const std::vector<gfx::Point3F>& points() const { return points_; }
56 const gfx::Vector3dF& normal() const { return normal_; } 56 const gfx::Vector3dF& normal() const { return normal_; }
57 const DrawQuad* original_ref() const { return original_ref_; } 57 const DrawQuad* original_ref() const { return original_ref_; }
58 int order_index() const { return order_index_; } 58 int order_index() const { return order_index_; }
59 bool is_split() const { return is_split_; } 59 bool is_split() const { return is_split_; }
60 scoped_ptr<DrawPolygon> CreateCopy(); 60 scoped_ptr<DrawPolygon> CreateCopy();
61 61
62 void RecomputeNormalForTesting();
63
62 private: 64 private:
63 void ApplyTransform(const gfx::Transform& transform); 65 void ApplyTransform(const gfx::Transform& transform);
64 void ApplyTransformToNormal(const gfx::Transform& transform); 66 void ApplyTransformToNormal(const gfx::Transform& transform);
65 67
68 void ConstructNormal();
69
66 std::vector<gfx::Point3F> points_; 70 std::vector<gfx::Point3F> points_;
67 // Normalized, necessitated by distance calculations and tests of coplanarity. 71 // Normalized, necessitated by distance calculations and tests of coplanarity.
68 gfx::Vector3dF normal_; 72 gfx::Vector3dF normal_;
69 // This is an index that can be used to test whether a quad comes before or 73 // This is an index that can be used to test whether a quad comes before or
70 // after another in document order, useful for tie-breaking when it comes 74 // after another in document order, useful for tie-breaking when it comes
71 // to coplanar surfaces. 75 // to coplanar surfaces.
72 int order_index_; 76 int order_index_;
73 // The pointer to the original quad, which gives us all the drawing info 77 // The pointer to the original quad, which gives us all the drawing info
74 // we need. 78 // we need.
75 // This DrawQuad is owned by the caller and its lifetime must be preserved 79 // This DrawQuad is owned by the caller and its lifetime must be preserved
76 // as long as this DrawPolygon is alive. 80 // as long as this DrawPolygon is alive.
77 const DrawQuad* original_ref_; 81 const DrawQuad* original_ref_;
78 bool is_split_; 82 bool is_split_;
79 }; 83 };
80 84
81 } // namespace cc 85 } // namespace cc
82 86
83 #endif // CC_QUADS_DRAW_POLYGON_H_ 87 #endif // CC_QUADS_DRAW_POLYGON_H_
OLDNEW
« no previous file with comments | « no previous file | cc/quads/draw_polygon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698