| OLD | NEW |
| 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_DEFINED | 8 #ifndef SkLinearBitmapPipeline_DEFINED |
| 9 #define SkLinearBitmapPipeline_DEFINED | 9 #define SkLinearBitmapPipeline_DEFINED |
| 10 | 10 |
| 11 #include <algorithm> | 11 |
| 12 #include <cmath> | |
| 13 #include <limits> | |
| 14 #include <cstdio> | |
| 15 #include "SkColor.h" | 12 #include "SkColor.h" |
| 16 #include "SkImageInfo.h" | 13 #include "SkImageInfo.h" |
| 17 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
| 15 #include "SkNx.h" |
| 18 #include "SkShader.h" | 16 #include "SkShader.h" |
| 19 #include "SkSize.h" | |
| 20 #include "SkNx.h" | |
| 21 | 17 |
| 22 using Sk4fArg = const Sk4f&; | 18 using Sk4fArg = const Sk4f&; |
| 23 | 19 |
| 24 class PointProcessorInterface { | 20 class PointProcessorInterface { |
| 25 public: | 21 public: |
| 26 virtual ~PointProcessorInterface() { } | 22 virtual ~PointProcessorInterface() { } |
| 27 virtual void pointListFew(int n, Sk4fArg xs, Sk4fArg ys) = 0; | 23 virtual void pointListFew(int n, Sk4fArg xs, Sk4fArg ys) = 0; |
| 28 virtual void pointList4(Sk4fArg xs, Sk4fArg ys) = 0; | 24 virtual void pointList4(Sk4fArg xs, Sk4fArg ys) = 0; |
| 29 }; | 25 }; |
| 30 | 26 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 virtual void placePixel(Sk4fArg pixel0) = 0; | 48 virtual void placePixel(Sk4fArg pixel0) = 0; |
| 53 virtual void place4Pixels(Sk4fArg p0, Sk4fArg p1, Sk4fArg p2, Sk4fArg p3) =
0; | 49 virtual void place4Pixels(Sk4fArg p0, Sk4fArg p1, Sk4fArg p2, Sk4fArg p3) =
0; |
| 54 }; | 50 }; |
| 55 | 51 |
| 56 class SkLinearBitmapPipeline { | 52 class SkLinearBitmapPipeline { |
| 57 public: | 53 public: |
| 58 SkLinearBitmapPipeline( | 54 SkLinearBitmapPipeline( |
| 59 const SkMatrix& inverse, | 55 const SkMatrix& inverse, |
| 60 SkFilterQuality filterQuality, | 56 SkFilterQuality filterQuality, |
| 61 SkShader::TileMode xTile, SkShader::TileMode yTile, | 57 SkShader::TileMode xTile, SkShader::TileMode yTile, |
| 62 const SkImageInfo& srcImageInfo, | 58 const SkPixmap& srcPixmap); |
| 63 const void* srcImageData); | |
| 64 | 59 |
| 65 void shadeSpan4f(int x, int y, SkPM4f* dst, int count); | 60 void shadeSpan4f(int x, int y, SkPM4f* dst, int count); |
| 66 | 61 |
| 67 template<typename Base, size_t kSize> | 62 template<typename Base, size_t kSize> |
| 68 class PolymorphicUnion { | 63 class PolymorphicUnion { |
| 69 public: | 64 public: |
| 70 PolymorphicUnion() {} | 65 PolymorphicUnion() {} |
| 71 | 66 |
| 72 ~PolymorphicUnion() { get()->~Base(); } | 67 ~PolymorphicUnion() { get()->~Base(); } |
| 73 | 68 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 PointProcessorInterface* fFirstStage; | 95 PointProcessorInterface* fFirstStage; |
| 101 MatrixStage fMatrixStage; | 96 MatrixStage fMatrixStage; |
| 102 FilterStage fFilterStage; | 97 FilterStage fFilterStage; |
| 103 TileStage fTileXOrBothStage; | 98 TileStage fTileXOrBothStage; |
| 104 TileStage fTileYStage; | 99 TileStage fTileYStage; |
| 105 SampleStage fSampleStage; | 100 SampleStage fSampleStage; |
| 106 PixelStage fPixelStage; | 101 PixelStage fPixelStage; |
| 107 }; | 102 }; |
| 108 | 103 |
| 109 #endif // SkLinearBitmapPipeline_DEFINED | 104 #endif // SkLinearBitmapPipeline_DEFINED |
| OLD | NEW |