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 "SkColor.h" | 11 #include "SkColor.h" |
12 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
13 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
14 #include "SkShader.h" | 14 #include "SkShader.h" |
15 | 15 |
16 class SkLinearBitmapPipeline { | 16 class SkLinearBitmapPipeline { |
17 public: | 17 public: |
18 SkLinearBitmapPipeline( | 18 SkLinearBitmapPipeline( |
19 const SkMatrix& inverse, | 19 const SkMatrix& inverse, |
20 SkFilterQuality filterQuality, | 20 SkFilterQuality filterQuality, |
21 SkShader::TileMode xTile, SkShader::TileMode yTile, | 21 SkShader::TileMode xTile, SkShader::TileMode yTile, |
22 float postAlpha, | 22 float postAlpha, |
23 const SkPixmap& srcPixmap); | 23 const SkPixmap& srcPixmap); |
| 24 |
| 25 SkLinearBitmapPipeline( |
| 26 const SkLinearBitmapPipeline& pipeline, |
| 27 SkXfermode::Mode mode, |
| 28 const SkPixmap& srcPixmap, |
| 29 const SkImageInfo& dstInfo); |
| 30 |
24 ~SkLinearBitmapPipeline(); | 31 ~SkLinearBitmapPipeline(); |
25 | 32 |
26 void shadeSpan4f(int x, int y, SkPM4f* dst, int count); | 33 void shadeSpan4f(int x, int y, SkPM4f* dst, int count); |
| 34 void blitSpan(int32_t x, int32_t y, void* dst, int count); |
27 | 35 |
28 template<typename Base, size_t kSize, typename Next = void> | 36 template<typename Base, size_t kSize, typename Next = void> |
29 class Stage { | 37 class Stage { |
30 public: | 38 public: |
31 Stage() : fIsInitialized{false} {} | 39 Stage() : fIsInitialized{false} {} |
32 ~Stage(); | 40 ~Stage(); |
33 | 41 |
34 template<typename Variant, typename... Args> | 42 template<typename Variant, typename... Args> |
35 void initStage(Next* next, Args&& ... args); | 43 void initStage(Next* next, Args&& ... args); |
36 | 44 |
(...skipping 21 matching lines...) Expand all Loading... |
58 bool fIsInitialized; | 66 bool fIsInitialized; |
59 mutable Space fSpace; | 67 mutable Space fSpace; |
60 }; | 68 }; |
61 | 69 |
62 class PointProcessorInterface; | 70 class PointProcessorInterface; |
63 class SampleProcessorInterface; | 71 class SampleProcessorInterface; |
64 class BlendProcessorInterface; | 72 class BlendProcessorInterface; |
65 class DestinationInterface; | 73 class DestinationInterface; |
66 | 74 |
67 // These values were generated by the assert above in Stage::init{Sink|Stage
}. | 75 // These values were generated by the assert above in Stage::init{Sink|Stage
}. |
68 using MatrixStage = Stage<PointProcessorInterface, 160, PointProcessorInter
face>; | 76 using MatrixStage = Stage<PointProcessorInterface, 160, PointProcessorInte
rface>; |
69 using TileStage = Stage<PointProcessorInterface, 160, SampleProcessorInte
rface>; | 77 using TileStage = Stage<PointProcessorInterface, 160, SampleProcessorInt
erface>; |
70 using SampleStage = Stage<SampleProcessorInterface, 100, BlendProcessorInte
rface>; | 78 using SampleStage = Stage<SampleProcessorInterface, 100, BlendProcessorInte
rface>; |
71 using BlenderStage = Stage<BlendProcessorInterface, 80>; | 79 using BlenderStage = Stage<BlendProcessorInterface, 40>; |
72 | 80 |
73 private: | 81 private: |
74 PointProcessorInterface* fFirstStage; | 82 PointProcessorInterface* fFirstStage; |
75 MatrixStage fMatrixStage; | 83 MatrixStage fMatrixStage; |
76 TileStage fTileStage; | 84 TileStage fTileStage; |
77 SampleStage fSampleStage; | 85 SampleStage fSampleStage; |
78 BlenderStage fBlenderStage; | 86 BlenderStage fBlenderStage; |
79 DestinationInterface* fLastStage; | 87 DestinationInterface* fLastStage; |
80 }; | 88 }; |
81 | 89 |
82 #endif // SkLinearBitmapPipeline_DEFINED | 90 #endif // SkLinearBitmapPipeline_DEFINED |
OLD | NEW |