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 SkLocalMatrixShader_DEFINED | 8 #ifndef SkLocalMatrixShader_DEFINED |
9 #define SkLocalMatrixShader_DEFINED | 9 #define SkLocalMatrixShader_DEFINED |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 size_t contextSize() const override { | 22 size_t contextSize() const override { |
23 return fProxyShader->contextSize(); | 23 return fProxyShader->contextSize(); |
24 } | 24 } |
25 | 25 |
26 GradientType asAGradient(GradientInfo* info) const override { | 26 GradientType asAGradient(GradientInfo* info) const override { |
27 return fProxyShader->asAGradient(info); | 27 return fProxyShader->asAGradient(info); |
28 } | 28 } |
29 | 29 |
30 #if SK_SUPPORT_GPU | 30 #if SK_SUPPORT_GPU |
31 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM
atrix& viewM, | 31 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM
atrix& viewM, |
32 const SkMatrix* localMatrix, SkFilterQua
lity fq, | 32 const SkMatrix* localMatrix, |
33 GrProcessorDataManager* procDataManager)
const override { | 33 SkFilterQuality fq) const ove
rride { |
34 SkMatrix tmp = this->getLocalMatrix(); | 34 SkMatrix tmp = this->getLocalMatrix(); |
35 if (localMatrix) { | 35 if (localMatrix) { |
36 tmp.preConcat(*localMatrix); | 36 tmp.preConcat(*localMatrix); |
37 } | 37 } |
38 return fProxyShader->asFragmentProcessor(context, viewM, &tmp, fq, procD
ataManager); | 38 return fProxyShader->asFragmentProcessor(context, viewM, &tmp, fq); |
39 } | 39 } |
40 #endif | 40 #endif |
41 | 41 |
42 SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const override { | 42 SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const override { |
43 if (localMatrix) { | 43 if (localMatrix) { |
44 *localMatrix = this->getLocalMatrix(); | 44 *localMatrix = this->getLocalMatrix(); |
45 } | 45 } |
46 return SkRef(fProxyShader.get()); | 46 return SkRef(fProxyShader.get()); |
47 } | 47 } |
48 | 48 |
49 SK_TO_STRING_OVERRIDE() | 49 SK_TO_STRING_OVERRIDE() |
50 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader) | 50 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader) |
51 | 51 |
52 protected: | 52 protected: |
53 void flatten(SkWriteBuffer&) const override; | 53 void flatten(SkWriteBuffer&) const override; |
54 Context* onCreateContext(const ContextRec&, void*) const override; | 54 Context* onCreateContext(const ContextRec&, void*) const override; |
55 | 55 |
56 bool onIsABitmap(SkBitmap* bitmap, SkMatrix* matrix, TileMode* mode) const o
verride { | 56 bool onIsABitmap(SkBitmap* bitmap, SkMatrix* matrix, TileMode* mode) const o
verride { |
57 return fProxyShader->isABitmap(bitmap, matrix, mode); | 57 return fProxyShader->isABitmap(bitmap, matrix, mode); |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 SkAutoTUnref<SkShader> fProxyShader; | 61 SkAutoTUnref<SkShader> fProxyShader; |
62 | 62 |
63 typedef SkShader INHERITED; | 63 typedef SkShader INHERITED; |
64 }; | 64 }; |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |