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 |
11 #define SkBitmapProcShader_DEFINED | 11 #define SkBitmapProcShader_DEFINED |
12 | 12 |
13 #include "SkShader.h" | 13 #include "SkShader.h" |
14 #include "SkBitmapProcState.h" | 14 #include "SkBitmapProcState.h" |
15 #include "SkSmallAllocator.h" | 15 #include "SkSmallAllocator.h" |
16 | 16 |
17 class SkBitmapProcShader : public SkShader { | 17 class SkBitmapProcShader : public SkShader { |
18 public: | 18 public: |
19 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty); | 19 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty, |
| 20 const SkMatrix* localMatrix = NULL); |
20 | 21 |
21 // overrides from SkShader | 22 // overrides from SkShader |
22 virtual bool isOpaque() const SK_OVERRIDE; | 23 virtual bool isOpaque() const SK_OVERRIDE; |
23 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR
IDE; | 24 virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERR
IDE; |
24 | 25 |
25 virtual bool validContext(const SkBitmap& device, | 26 virtual bool validContext(const SkBitmap& device, |
26 const SkPaint& paint, | 27 const SkPaint& paint, |
27 const SkMatrix& matrix, | 28 const SkMatrix& matrix, |
28 SkMatrix* totalInverse = NULL) const SK_OVERRIDE; | 29 SkMatrix* totalInverse = NULL) const SK_OVERRIDE; |
29 virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&, | 30 virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not | 85 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not |
85 // yet found a situation where the size below isn't big enough. | 86 // yet found a situation where the size below isn't big enough. |
86 typedef SkSmallAllocator<3, sizeof(SkBitmapProcShader) + | 87 typedef SkSmallAllocator<3, sizeof(SkBitmapProcShader) + |
87 sizeof(SkBitmapProcShader::BitmapProcShaderContext)
+ | 88 sizeof(SkBitmapProcShader::BitmapProcShaderContext)
+ |
88 sizeof(SkBitmapProcState) + | 89 sizeof(SkBitmapProcState) + |
89 sizeof(void*) * 2> SkTBlitterAllocator; | 90 sizeof(void*) * 2> SkTBlitterAllocator; |
90 | 91 |
91 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and
MUST outlive | 92 // If alloc is non-NULL, it will be used to allocate the returned SkShader, and
MUST outlive |
92 // the SkShader. | 93 // the SkShader. |
93 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::
TileMode, | 94 SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::
TileMode, |
94 SkTBlitterAllocator* alloc); | 95 const SkMatrix* localMatrix, SkTBlitterAllocator* a
lloc); |
95 | 96 |
96 #endif | 97 #endif |
OLD | NEW |