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

Unified Diff: src/core/SkLinearBitmapPipeline.h

Issue 1723683002: Better encapsulation and vector calling convention. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make inlines VECTORCALL. Created 4 years, 10 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 | « no previous file | src/core/SkLinearBitmapPipeline.cpp » ('j') | src/core/SkLinearBitmapPipeline.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLinearBitmapPipeline.h
diff --git a/src/core/SkLinearBitmapPipeline.h b/src/core/SkLinearBitmapPipeline.h
index d9748df75061854968ef947b4b35599fb65f791b..3d5dd31df34d533531ac87473f092e75cd6637d5 100644
--- a/src/core/SkLinearBitmapPipeline.h
+++ b/src/core/SkLinearBitmapPipeline.h
@@ -15,53 +15,6 @@
#include "SkNx.h"
#include "SkShader.h"
-using Sk4fArg = const Sk4f&;
-
-class PointProcessorInterface {
-public:
- virtual ~PointProcessorInterface() { }
- virtual void pointListFew(int n, Sk4fArg xs, Sk4fArg ys) = 0;
- virtual void pointList4(Sk4fArg xs, Sk4fArg ys) = 0;
-
- // The pointSpan method efficiently process horizontal spans of pixels.
- // * start - the point where to start the span.
- // * length - the number of pixels to traverse in source space.
- // * count - the number of pixels to produce in destination space.
- // Both start and length are mapped through the inversion matrix to produce values in source
- // space. After the matrix operation, the tilers may break the spans up into smaller spans.
- // The tilers can produce spans that seem nonsensical.
- // * The clamp tiler can create spans with length of 0. This indicates to copy an edge pixel out
- // to the edge of the destination scan.
- // * The mirror tiler can produce spans with negative length. This indicates that the source
- // should be traversed in the opposite direction to the destination pixels.
- virtual void pointSpan(SkPoint start, SkScalar length, int count) = 0;
-};
-
-class BilerpProcessorInterface : public PointProcessorInterface {
-public:
- // The x's and y's are setup in the following order:
- // +--------+--------+
- // | | |
- // | px00 | px10 |
- // | 0 | 1 |
- // +--------+--------+
- // | | |
- // | px01 | px11 |
- // | 2 | 3 |
- // +--------+--------+
- // These pixels coordinates are arranged in the following order in xs and ys:
- // px00 px10 px01 px11
- virtual void bilerpList(Sk4fArg xs, Sk4fArg ys) = 0;
-};
-
-class PixelPlacerInterface {
-public:
- virtual ~PixelPlacerInterface() { }
- virtual void setDestination(SkPM4f* dst) = 0;
- virtual void placePixel(Sk4fArg pixel0) = 0;
- virtual void place4Pixels(Sk4fArg p0, Sk4fArg p1, Sk4fArg p2, Sk4fArg p3) = 0;
-};
-
class SkLinearBitmapPipeline {
public:
SkLinearBitmapPipeline(
@@ -69,6 +22,7 @@ public:
SkFilterQuality filterQuality,
SkShader::TileMode xTile, SkShader::TileMode yTile,
const SkPixmap& srcPixmap);
+ ~SkLinearBitmapPipeline();
void shadeSpan4f(int x, int y, SkPM4f* dst, int count);
@@ -98,6 +52,10 @@ public:
mutable Space fSpace;
};
+ class PointProcessorInterface;
+ class BilerpProcessorInterface;
+ class PixelPlacerInterface;
+
using MatrixStage = PolymorphicUnion<PointProcessorInterface, 112>;
using FilterStage = PolymorphicUnion<PointProcessorInterface, 8>;
using TileStage = PolymorphicUnion<BilerpProcessorInterface, 96>;
« no previous file with comments | « no previous file | src/core/SkLinearBitmapPipeline.cpp » ('j') | src/core/SkLinearBitmapPipeline.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698