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 16 matching lines...) Expand all Loading... |
27 TileMode* mode) const SK_OVERRIDE { | 27 TileMode* mode) const SK_OVERRIDE { |
28 return fProxyShader->asABitmap(bitmap, matrix, mode); | 28 return fProxyShader->asABitmap(bitmap, matrix, mode); |
29 } | 29 } |
30 | 30 |
31 virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE { | 31 virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE { |
32 return fProxyShader->asAGradient(info); | 32 return fProxyShader->asAGradient(info); |
33 } | 33 } |
34 | 34 |
35 #if SK_SUPPORT_GPU | 35 #if SK_SUPPORT_GPU |
36 | 36 |
37 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM
atrix* localMatrix, | 37 virtual bool asFragmentProcessor(GrContext* context, const SkPaint& paint, |
38 GrColor* grColor, GrEffect** grEffect) const SK_OVE
RRIDE { | 38 const SkMatrix* localMatrix, GrColor* grCol
or, |
| 39 GrFragmentProcessor** fp) const SK_OVERRIDE
{ |
39 SkMatrix tmp = this->getLocalMatrix(); | 40 SkMatrix tmp = this->getLocalMatrix(); |
40 if (localMatrix) { | 41 if (localMatrix) { |
41 tmp.preConcat(*localMatrix); | 42 tmp.preConcat(*localMatrix); |
42 } | 43 } |
43 return fProxyShader->asNewEffect(context, paint, &tmp, grColor, grEffect
); | 44 return fProxyShader->asFragmentProcessor(context, paint, &tmp, grColor,
fp); |
44 } | 45 } |
45 | 46 |
46 #else | 47 #else |
47 | 48 |
48 virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkM
atrix* localMatrix, | 49 virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*
, GrColor*, |
49 GrColor* grColor, GrEffect** grEffect) const SK_OVE
RRIDE { | 50 GrFragmentProcessor**) const SK_OVERRIDE { |
50 SkDEBUGFAIL("Should not call in GPU-less build"); | 51 SkDEBUGFAIL("Should not call in GPU-less build"); |
51 return false; | 52 return false; |
52 } | 53 } |
53 | 54 |
54 #endif | 55 #endif |
55 | 56 |
56 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OV
ERRIDE { | 57 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OV
ERRIDE { |
57 if (localMatrix) { | 58 if (localMatrix) { |
58 *localMatrix = this->getLocalMatrix(); | 59 *localMatrix = this->getLocalMatrix(); |
59 } | 60 } |
(...skipping 10 matching lines...) Expand all Loading... |
70 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 71 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
71 virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE
; | 72 virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE
; |
72 | 73 |
73 private: | 74 private: |
74 SkAutoTUnref<SkShader> fProxyShader; | 75 SkAutoTUnref<SkShader> fProxyShader; |
75 | 76 |
76 typedef SkShader INHERITED; | 77 typedef SkShader INHERITED; |
77 }; | 78 }; |
78 | 79 |
79 #endif | 80 #endif |
OLD | NEW |