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

Side by Side Diff: src/core/SkLinearBitmapPipeline_matrix.h

Issue 1775963002: Bilerp + mirror + perspective (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments. Created 4 years, 9 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 | « src/core/SkLinearBitmapPipeline_core.h ('k') | src/core/SkLinearBitmapPipeline_sample.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkLinearBitmapPipeline_matrix_DEFINED 8 #ifndef SkLinearBitmapPipeline_matrix_DEFINED
9 #define SkLinearBitmapPipeline_matrix_DEFINED 9 #define SkLinearBitmapPipeline_matrix_DEFINED
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool maybeProcessSpan(Span span, Next* next) { 78 bool maybeProcessSpan(Span span, Next* next) {
79 return false; 79 return false;
80 } 80 }
81 81
82 private: 82 private:
83 const Sk4s fXOffset, fYOffset; 83 const Sk4s fXOffset, fYOffset;
84 const Sk4s fXScale, fYScale; 84 const Sk4s fXScale, fYScale;
85 const Sk4s fXSkew, fYSkew; 85 const Sk4s fXSkew, fYSkew;
86 }; 86 };
87 87
88 class PerspectiveMatrixStrategy {
89 public:
90 PerspectiveMatrixStrategy(SkVector offset, SkVector scale, SkVector skew,
91 SkVector zSkew, SkScalar zOffset)
92 : fXOffset{X(offset)}, fYOffset{Y(offset)}, fZOffset{zOffset}
93 , fXScale{X(scale)}, fYScale{Y(scale)}
94 , fXSkew{X(skew)}, fYSkew{Y(skew)}, fZXSkew{X(zSkew)}, fZYSkew{Y(zSk ew)} { }
95 void processPoints(Sk4s* xs, Sk4s* ys) {
96 Sk4s newXs = fXScale * *xs + fXSkew * *ys + fXOffset;
97 Sk4s newYs = fYSkew * *xs + fYScale * *ys + fYOffset;
98 Sk4s newZs = fZXSkew * *xs + fZYSkew * *ys + fZOffset;
99
100 *xs = newXs / newZs;
101 *ys = newYs / newZs;
102 }
103
104 template <typename Next>
105 bool maybeProcessSpan(Span span, Next* next) {
106 return false;
107 }
108
109 private:
110 const Sk4s fXOffset, fYOffset, fZOffset;
111 const Sk4s fXScale, fYScale;
112 const Sk4s fXSkew, fYSkew, fZXSkew, fZYSkew;
113 };
114
115
88 } // namespace 116 } // namespace
89 117
90 #endif // SkLinearBitmapPipeline_matrix_DEFINED 118 #endif // SkLinearBitmapPipeline_matrix_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkLinearBitmapPipeline_core.h ('k') | src/core/SkLinearBitmapPipeline_sample.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698