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