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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkLinearBitmapPipeline_core.h ('k') | src/core/SkLinearBitmapPipeline_sample.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLinearBitmapPipeline_matrix.h
diff --git a/src/core/SkLinearBitmapPipeline_matrix.h b/src/core/SkLinearBitmapPipeline_matrix.h
index b1bd81f1630f655a2a0dd8e208c3f3bf11651288..d194d0729a7fa30eb0b159f3af03e5dc63918410 100644
--- a/src/core/SkLinearBitmapPipeline_matrix.h
+++ b/src/core/SkLinearBitmapPipeline_matrix.h
@@ -85,6 +85,34 @@ private:
const Sk4s fXSkew, fYSkew;
};
+class PerspectiveMatrixStrategy {
+public:
+ PerspectiveMatrixStrategy(SkVector offset, SkVector scale, SkVector skew,
+ SkVector zSkew, SkScalar zOffset)
+ : fXOffset{X(offset)}, fYOffset{Y(offset)}, fZOffset{zOffset}
+ , fXScale{X(scale)}, fYScale{Y(scale)}
+ , fXSkew{X(skew)}, fYSkew{Y(skew)}, fZXSkew{X(zSkew)}, fZYSkew{Y(zSkew)} { }
+ void processPoints(Sk4s* xs, Sk4s* ys) {
+ Sk4s newXs = fXScale * *xs + fXSkew * *ys + fXOffset;
+ Sk4s newYs = fYSkew * *xs + fYScale * *ys + fYOffset;
+ Sk4s newZs = fZXSkew * *xs + fZYSkew * *ys + fZOffset;
+
+ *xs = newXs / newZs;
+ *ys = newYs / newZs;
+ }
+
+ template <typename Next>
+ bool maybeProcessSpan(Span span, Next* next) {
+ return false;
+ }
+
+private:
+ const Sk4s fXOffset, fYOffset, fZOffset;
+ const Sk4s fXScale, fYScale;
+ const Sk4s fXSkew, fYSkew, fZXSkew, fZYSkew;
+};
+
+
} // namespace
#endif // SkLinearBitmapPipeline_matrix_DEFINED
« 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