aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLinearBitmapPipeline.h
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-02-17 19:50:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-17 19:50:05 -0800
commitc5eddd7d8d67a6e931973a729c5868c155cb751f (patch)
tree256e9d303b3f25339c59cc260f4a36a163e578b0 /src/core/SkLinearBitmapPipeline.h
parent576af8f0cc97f12f60eeea5c2434d079a62fd0db (diff)
Add bilerp filtering.
Diffstat (limited to 'src/core/SkLinearBitmapPipeline.h')
-rw-r--r--src/core/SkLinearBitmapPipeline.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/core/SkLinearBitmapPipeline.h b/src/core/SkLinearBitmapPipeline.h
index f6875c6a96..9d537df501 100644
--- a/src/core/SkLinearBitmapPipeline.h
+++ b/src/core/SkLinearBitmapPipeline.h
@@ -28,6 +28,23 @@ public:
virtual void pointList4(Sk4fArg xs, Sk4fArg ys) = 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() { }
@@ -40,6 +57,7 @@ class SkLinearBitmapPipeline {
public:
SkLinearBitmapPipeline(
const SkMatrix& inverse,
+ SkFilterQuality filterQuality,
SkShader::TileMode xTile, SkShader::TileMode yTile,
const SkImageInfo& srcImageInfo,
const void* srcImageData);
@@ -73,13 +91,15 @@ public:
};
using MatrixStage = PolymorphicUnion<PointProcessorInterface, 112>;
- using TileStage = PolymorphicUnion<PointProcessorInterface, 96>;
- using SampleStage = PolymorphicUnion<PointProcessorInterface, 80>;
+ using FilterStage = PolymorphicUnion<PointProcessorInterface, 8>;
+ using TileStage = PolymorphicUnion<BilerpProcessorInterface, 96>;
+ using SampleStage = PolymorphicUnion<BilerpProcessorInterface, 80>;
using PixelStage = PolymorphicUnion<PixelPlacerInterface, 80>;
private:
PointProcessorInterface* fFirstStage;
MatrixStage fMatrixStage;
+ FilterStage fFilterStage;
TileStage fTileXOrBothStage;
TileStage fTileYStage;
SampleStage fSampleStage;