| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkCoreBlitters_DEFINED | 8 #ifndef SkCoreBlitters_DEFINED |
| 9 #define SkCoreBlitters_DEFINED | 9 #define SkCoreBlitters_DEFINED |
| 10 | 10 |
| 11 #include "SkBitmapProcShader.h" | 11 #include "SkBitmapProcShader.h" |
| 12 #include "SkBlitter.h" | 12 #include "SkBlitter.h" |
| 13 #include "SkBlitRow.h" | 13 #include "SkBlitRow.h" |
| 14 #include "SkShader.h" | 14 #include "SkShader.h" |
| 15 #include "SkSmallAllocator.h" | 15 #include "SkSmallAllocator.h" |
| 16 | 16 |
| 17 class SkRasterBlitter : public SkBlitter { | 17 class SkRasterBlitter : public SkBlitter { |
| 18 public: | 18 public: |
| 19 SkRasterBlitter(const SkBitmap& device) : fDevice(device) {} | 19 SkRasterBlitter(const SkBitmap& device) : fDevice(device) {} |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 const SkBitmap& fDevice; | 22 const SkBitmap& fDevice; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 typedef SkBlitter INHERITED; | 25 typedef SkBlitter INHERITED; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class SkShaderBlitter : public SkRasterBlitter { | 28 class SkShaderBlitter : public SkRasterBlitter { |
| 29 public: | 29 public: |
| 30 SkShaderBlitter(const SkBitmap& device, const SkPaint& paint); | 30 SkShaderBlitter(const SkBitmap& device, const SkPaint& paint, |
| 31 SkShaderGenerator::ShaderImpl* shaderImpl); |
| 31 virtual ~SkShaderBlitter(); | 32 virtual ~SkShaderBlitter(); |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 uint32_t fShaderFlags; | 35 uint32_t fShaderFlags; |
| 35 SkShader* fShader; | 36 SkShaderGenerator::ShaderImpl* fShader; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 // illegal | 39 // illegal |
| 39 SkShaderBlitter& operator=(const SkShaderBlitter&); | 40 SkShaderBlitter& operator=(const SkShaderBlitter&); |
| 40 | 41 |
| 41 typedef SkRasterBlitter INHERITED; | 42 typedef SkRasterBlitter INHERITED; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 /////////////////////////////////////////////////////////////////////////////// | 45 /////////////////////////////////////////////////////////////////////////////// |
| 45 | 46 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 68 unsigned fSrcA; | 69 unsigned fSrcA; |
| 69 | 70 |
| 70 // illegal | 71 // illegal |
| 71 SkA8_Blitter& operator=(const SkA8_Blitter&); | 72 SkA8_Blitter& operator=(const SkA8_Blitter&); |
| 72 | 73 |
| 73 typedef SkRasterBlitter INHERITED; | 74 typedef SkRasterBlitter INHERITED; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 class SkA8_Shader_Blitter : public SkShaderBlitter { | 77 class SkA8_Shader_Blitter : public SkShaderBlitter { |
| 77 public: | 78 public: |
| 78 SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint& paint); | 79 SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint& paint, |
| 80 SkShaderGenerator::ShaderImpl* shaderImpl); |
| 79 virtual ~SkA8_Shader_Blitter(); | 81 virtual ~SkA8_Shader_Blitter(); |
| 80 virtual void blitH(int x, int y, int width); | 82 virtual void blitH(int x, int y, int width); |
| 81 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); | 83 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); |
| 82 virtual void blitMask(const SkMask&, const SkIRect&); | 84 virtual void blitMask(const SkMask&, const SkIRect&); |
| 83 | 85 |
| 84 private: | 86 private: |
| 85 SkXfermode* fXfermode; | 87 SkXfermode* fXfermode; |
| 86 SkPMColor* fBuffer; | 88 SkPMColor* fBuffer; |
| 87 uint8_t* fAAExpand; | 89 uint8_t* fAAExpand; |
| 88 | 90 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 SkARGB32_Black_Blitter(const SkBitmap& device, const SkPaint& paint) | 136 SkARGB32_Black_Blitter(const SkBitmap& device, const SkPaint& paint) |
| 135 : INHERITED(device, paint) {} | 137 : INHERITED(device, paint) {} |
| 136 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); | 138 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); |
| 137 | 139 |
| 138 private: | 140 private: |
| 139 typedef SkARGB32_Opaque_Blitter INHERITED; | 141 typedef SkARGB32_Opaque_Blitter INHERITED; |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 class SkARGB32_Shader_Blitter : public SkShaderBlitter { | 144 class SkARGB32_Shader_Blitter : public SkShaderBlitter { |
| 143 public: | 145 public: |
| 144 SkARGB32_Shader_Blitter(const SkBitmap& device, const SkPaint& paint); | 146 SkARGB32_Shader_Blitter(const SkBitmap& device, const SkPaint& paint, |
| 147 SkShaderGenerator::ShaderImpl* shaderImpl); |
| 145 virtual ~SkARGB32_Shader_Blitter(); | 148 virtual ~SkARGB32_Shader_Blitter(); |
| 146 virtual void blitH(int x, int y, int width) SK_OVERRIDE; | 149 virtual void blitH(int x, int y, int width) SK_OVERRIDE; |
| 147 virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE; | 150 virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE; |
| 148 virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE; | 151 virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE; |
| 149 virtual void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) SK_OV
ERRIDE; | 152 virtual void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) SK_OV
ERRIDE; |
| 150 virtual void blitMask(const SkMask&, const SkIRect&) SK_OVERRIDE; | 153 virtual void blitMask(const SkMask&, const SkIRect&) SK_OVERRIDE; |
| 151 | 154 |
| 152 private: | 155 private: |
| 153 SkXfermode* fXfermode; | 156 SkXfermode* fXfermode; |
| 154 SkPMColor* fBuffer; | 157 SkPMColor* fBuffer; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 | 175 |
| 173 1. If there is an xfermode, there will also be a shader | 176 1. If there is an xfermode, there will also be a shader |
| 174 2. If there is a colorfilter, there will be a shader that itself handles | 177 2. If there is a colorfilter, there will be a shader that itself handles |
| 175 calling the filter, so the blitter can always ignore the colorfilter obj | 178 calling the filter, so the blitter can always ignore the colorfilter obj |
| 176 | 179 |
| 177 These pre-conditions must be handled by the caller, in our case | 180 These pre-conditions must be handled by the caller, in our case |
| 178 SkBlitter::Choose(...) | 181 SkBlitter::Choose(...) |
| 179 */ | 182 */ |
| 180 | 183 |
| 181 SkBlitter* SkBlitter_ChooseD565(const SkBitmap& device, const SkPaint& paint, | 184 SkBlitter* SkBlitter_ChooseD565(const SkBitmap& device, const SkPaint& paint, |
| 185 SkShaderGenerator::ShaderImpl* shaderImpl, |
| 182 SkTBlitterAllocator* allocator); | 186 SkTBlitterAllocator* allocator); |
| 183 | 187 |
| 184 #endif | 188 #endif |
| OLD | NEW |