OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkPictureShader_DEFINED | 8 #ifndef SkPictureShader_DEFINED |
9 #define SkPictureShader_DEFINED | 9 #define SkPictureShader_DEFINED |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 SkPictureShader(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL); | 41 SkPictureShader(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL); |
42 | 42 |
43 SkShader* refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix) cons
t; | 43 SkShader* refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix) cons
t; |
44 | 44 |
45 SkPicture* fPicture; | 45 SkPicture* fPicture; |
46 TileMode fTmx, fTmy; | 46 TileMode fTmx, fTmy; |
47 | 47 |
48 mutable SkMutex fCachedBitmapShaderMutex; | 48 mutable SkMutex fCachedBitmapShaderMutex; |
49 mutable SkAutoTUnref<SkShader> fCachedBitmapShader; | 49 mutable SkAutoTUnref<SkShader> fCachedBitmapShader; |
50 mutable SkSize fCachedTileScale; | 50 mutable SkSize fCachedTileScale; |
51 mutable SkMatrix fCachedLocalMatrix; | |
52 | 51 |
53 class PictureShaderContext : public SkShader::Context { | 52 class PictureShaderContext : public SkShader::Context { |
54 public: | 53 public: |
55 static Context* Create(void* storage, const SkPictureShader&, const Cont
extRec&, | 54 static Context* Create(void* storage, const SkPictureShader&, const Cont
extRec&, |
56 SkShader* bitmapShader); | 55 SkShader* bitmapShader); |
57 | 56 |
58 virtual ~PictureShaderContext(); | 57 virtual ~PictureShaderContext(); |
59 | 58 |
60 virtual uint32_t getFlags() const SK_OVERRIDE; | 59 virtual uint32_t getFlags() const SK_OVERRIDE; |
61 | 60 |
62 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; | 61 virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; |
63 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVE
RRIDE; | 62 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVE
RRIDE; |
64 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OV
ERRIDE; | 63 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OV
ERRIDE; |
65 | 64 |
66 private: | 65 private: |
67 PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader
* bitmapShader); | 66 PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader
* bitmapShader); |
68 | 67 |
69 SkAutoTUnref<SkShader> fBitmapShader; | 68 SkAutoTUnref<SkShader> fBitmapShader; |
70 SkShader::Context* fBitmapShaderContext; | 69 SkShader::Context* fBitmapShaderContext; |
71 void* fBitmapShaderContextStorage; | 70 void* fBitmapShaderContextStorage; |
72 | 71 |
73 typedef SkShader::Context INHERITED; | 72 typedef SkShader::Context INHERITED; |
74 }; | 73 }; |
75 | 74 |
76 typedef SkShader INHERITED; | 75 typedef SkShader INHERITED; |
77 }; | 76 }; |
78 | 77 |
79 #endif // SkPictureShader_DEFINED | 78 #endif // SkPictureShader_DEFINED |
OLD | NEW |