| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkGradientShaderPriv_DEFINED | 8 #ifndef SkGradientShaderPriv_DEFINED |
| 9 #define SkGradientShaderPriv_DEFINED | 9 #define SkGradientShaderPriv_DEFINED |
| 10 | 10 |
| 11 #include "SkGradientShader.h" | 11 #include "SkGradientShader.h" |
| 12 #include "SkClampRange.h" | 12 #include "SkClampRange.h" |
| 13 #include "SkColorPriv.h" | 13 #include "SkColorPriv.h" |
| 14 #include "SkFlattenableBuffers.h" | 14 #include "SkReadBuffer.h" |
| 15 #include "SkWriteBuffer.h" |
| 15 #include "SkMallocPixelRef.h" | 16 #include "SkMallocPixelRef.h" |
| 16 #include "SkUnitMapper.h" | 17 #include "SkUnitMapper.h" |
| 17 #include "SkUtils.h" | 18 #include "SkUtils.h" |
| 18 #include "SkTemplates.h" | 19 #include "SkTemplates.h" |
| 19 #include "SkBitmapCache.h" | 20 #include "SkBitmapCache.h" |
| 20 #include "SkShader.h" | 21 #include "SkShader.h" |
| 21 | 22 |
| 22 static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, | 23 static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, |
| 23 int count) { | 24 int count) { |
| 24 if (count > 0) { | 25 if (count > 0) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 kSqrt32Shift = 8 - kCache32Bits, | 123 kSqrt32Shift = 8 - kCache32Bits, |
| 123 | 124 |
| 124 /// This value is used to *read* the dither cache; it may be 0 | 125 /// This value is used to *read* the dither cache; it may be 0 |
| 125 /// if dithering is disabled. | 126 /// if dithering is disabled. |
| 126 kDitherStride32 = kCache32Count, | 127 kDitherStride32 = kCache32Count, |
| 127 kDitherStride16 = kCache16Count, | 128 kDitherStride16 = kCache16Count, |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 | 131 |
| 131 protected: | 132 protected: |
| 132 SkGradientShaderBase(SkFlattenableReadBuffer& ); | 133 SkGradientShaderBase(SkReadBuffer& ); |
| 133 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 134 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 134 SK_DEVELOPER_TO_STRING() | 135 SK_DEVELOPER_TO_STRING() |
| 135 | 136 |
| 136 SkUnitMapper* fMapper; | 137 SkUnitMapper* fMapper; |
| 137 SkMatrix fPtsToUnit; // set by subclass | 138 SkMatrix fPtsToUnit; // set by subclass |
| 138 SkMatrix fDstToIndex; | 139 SkMatrix fDstToIndex; |
| 139 SkMatrix::MapXYProc fDstToIndexProc; | 140 SkMatrix::MapXYProc fDstToIndexProc; |
| 140 TileMode fTileMode; | 141 TileMode fTileMode; |
| 141 TileProc fTileProc; | 142 TileProc fTileProc; |
| 142 int fColorCount; | 143 int fColorCount; |
| 143 uint8_t fDstToIndexClass; | 144 uint8_t fDstToIndexClass; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 GrGLUniformManager::UniformHandle fColorStartUni; | 381 GrGLUniformManager::UniformHandle fColorStartUni; |
| 381 GrGLUniformManager::UniformHandle fColorMidUni; | 382 GrGLUniformManager::UniformHandle fColorMidUni; |
| 382 GrGLUniformManager::UniformHandle fColorEndUni; | 383 GrGLUniformManager::UniformHandle fColorEndUni; |
| 383 | 384 |
| 384 typedef GrGLEffect INHERITED; | 385 typedef GrGLEffect INHERITED; |
| 385 }; | 386 }; |
| 386 | 387 |
| 387 #endif | 388 #endif |
| 388 | 389 |
| 389 #endif | 390 #endif |
| OLD | NEW |