OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkBitmapProcShader_DEFINED | 10 #ifndef SkBitmapProcShader_DEFINED |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 virtual uint32_t getFlags() const SK_OVERRIDE { return fFlags; } | 48 virtual uint32_t getFlags() const SK_OVERRIDE { return fFlags; } |
49 | 49 |
50 private: | 50 private: |
51 SkBitmapProcState* fState; | 51 SkBitmapProcState* fState; |
52 uint32_t fFlags; | 52 uint32_t fFlags; |
53 | 53 |
54 typedef SkShader::Context INHERITED; | 54 typedef SkShader::Context INHERITED; |
55 }; | 55 }; |
56 | 56 |
57 protected: | 57 protected: |
| 58 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
58 SkBitmapProcShader(SkReadBuffer& ); | 59 SkBitmapProcShader(SkReadBuffer& ); |
| 60 #endif |
59 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 61 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
60 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_
OVERRIDE; | 62 virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_
OVERRIDE; |
61 | 63 |
62 SkBitmap fRawBitmap; // experimental for RLE encoding | 64 SkBitmap fRawBitmap; // experimental for RLE encoding |
63 uint8_t fTileModeX, fTileModeY; | 65 uint8_t fTileModeX, fTileModeY; |
64 | 66 |
65 private: | 67 private: |
66 typedef SkShader INHERITED; | 68 typedef SkShader INHERITED; |
67 }; | 69 }; |
68 | 70 |
69 // Commonly used allocator. It currently is only used to allocate up to 3 object
s. The total | 71 // Commonly used allocator. It currently is only used to allocate up to 3 object
s. The total |
70 // bytes requested is calculated using one of our large shaders, its context siz
e plus the size of | 72 // bytes requested is calculated using one of our large shaders, its context siz
e plus the size of |
71 // an Sk3DBlitter in SkDraw.cpp | 73 // an Sk3DBlitter in SkDraw.cpp |
72 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not | 74 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not |
73 // yet found a situation where the size below isn't big enough. | 75 // yet found a situation where the size below isn't big enough. |
74 typedef SkSmallAllocator<3, 768> SkTBlitterAllocator; | 76 typedef SkSmallAllocator<3, 768> SkTBlitterAllocator; |
75 | 77 |
76 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and
MUST outlive | 78 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and
MUST outlive |
77 // the SkShader. | 79 // the SkShader. |
78 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::
TileMode, | 80 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::
TileMode, |
79 const SkMatrix* localMatrix, SkTBlitterAllocator* a
lloc); | 81 const SkMatrix* localMatrix, SkTBlitterAllocator* a
lloc); |
80 | 82 |
81 #endif | 83 #endif |
OLD | NEW |