| 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 SkBitmapProcShader_DEFINED | 8 #ifndef SkBitmapProcShader_DEFINED |
| 9 #define SkBitmapProcShader_DEFINED | 9 #define SkBitmapProcShader_DEFINED |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 private: | 43 private: |
| 44 friend class SkImageShader; | 44 friend class SkImageShader; |
| 45 | 45 |
| 46 static size_t ContextSize(const ContextRec&, const SkImageInfo& srcInfo); | 46 static size_t ContextSize(const ContextRec&, const SkImageInfo& srcInfo); |
| 47 static Context* MakeContext(const SkShader&, TileMode tmx, TileMode tmy, | 47 static Context* MakeContext(const SkShader&, TileMode tmx, TileMode tmy, |
| 48 const SkBitmapProvider&, const ContextRec&, void
* storage); | 48 const SkBitmapProvider&, const ContextRec&, void
* storage); |
| 49 | 49 |
| 50 typedef SkShader INHERITED; | 50 typedef SkShader INHERITED; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 enum {kSkBlitterContextSize = 2400}; | 53 enum {kSkBlitterContextSize = 3100}; |
| 54 | 54 |
| 55 // Commonly used allocator. It currently is only used to allocate up to 3 object
s. The total | 55 // Commonly used allocator. It currently is only used to allocate up to 3 object
s. The total |
| 56 // bytes requested is calculated using one of our large shaders, its context siz
e plus the size of | 56 // bytes requested is calculated using one of our large shaders, its context siz
e plus the size of |
| 57 // an Sk3DBlitter in SkDraw.cpp | 57 // an Sk3DBlitter in SkDraw.cpp |
| 58 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not | 58 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not |
| 59 // yet found a situation where the size below isn't big enough. | 59 // yet found a situation where the size below isn't big enough. |
| 60 typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator; | 60 typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator; |
| 61 | 61 |
| 62 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a
nd MUST outlive | 62 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a
nd MUST outlive |
| 63 // the SkShader. | 63 // the SkShader. |
| 64 sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh
ader::TileMode, | 64 sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh
ader::TileMode, |
| 65 const SkMatrix* localMatrix, SkTBlitterAlloca
tor* alloc); | 65 const SkMatrix* localMatrix, SkTBlitterAlloca
tor* alloc); |
| 66 | 66 |
| 67 #endif | 67 #endif |
| OLD | NEW |