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 SkComposeShader_DEFINED | 10 #ifndef SkComposeShader_DEFINED |
(...skipping 18 matching lines...) Expand all Loading... |
29 @param shaderA The colors from this shader are seen as the "dst" by the
xfermode | 29 @param shaderA The colors from this shader are seen as the "dst" by the
xfermode |
30 @param shaderB The colors from this shader are seen as the "src" by the
xfermode | 30 @param shaderB The colors from this shader are seen as the "src" by the
xfermode |
31 @param mode The xfermode that combines the colors from the two shade
rs. If mode | 31 @param mode The xfermode that combines the colors from the two shade
rs. If mode |
32 is null, then SRC_OVER is assumed. | 32 is null, then SRC_OVER is assumed. |
33 */ | 33 */ |
34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL); | 34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL); |
35 virtual ~SkComposeShader(); | 35 virtual ~SkComposeShader(); |
36 | 36 |
37 size_t contextSize() const override; | 37 size_t contextSize() const override; |
38 | 38 |
| 39 #if SK_SUPPORT_GPU |
| 40 const GrFragmentProcessor* asFragmentProcessor(GrContext*, |
| 41 const SkMatrix& viewM, |
| 42 const SkMatrix* localMatrix, |
| 43 SkFilterQuality, |
| 44 GrProcessorDataManager*) con
st override; |
| 45 #endif |
| 46 |
39 class ComposeShaderContext : public SkShader::Context { | 47 class ComposeShaderContext : public SkShader::Context { |
40 public: | 48 public: |
41 // When this object gets destroyed, it will call contextA and contextB's
destructor | 49 // When this object gets destroyed, it will call contextA and contextB's
destructor |
42 // but it will NOT free the memory. | 50 // but it will NOT free the memory. |
43 ComposeShaderContext(const SkComposeShader&, const ContextRec&, | 51 ComposeShaderContext(const SkComposeShader&, const ContextRec&, |
44 SkShader::Context* contextA, SkShader::Context* con
textB); | 52 SkShader::Context* contextA, SkShader::Context* con
textB); |
45 | 53 |
46 SkShader::Context* getShaderContextA() const { return fShaderContextA; } | 54 SkShader::Context* getShaderContextA() const { return fShaderContextA; } |
47 SkShader::Context* getShaderContextB() const { return fShaderContextB; } | 55 SkShader::Context* getShaderContextB() const { return fShaderContextB; } |
48 | 56 |
(...skipping 25 matching lines...) Expand all Loading... |
74 | 82 |
75 private: | 83 private: |
76 SkShader* fShaderA; | 84 SkShader* fShaderA; |
77 SkShader* fShaderB; | 85 SkShader* fShaderB; |
78 SkXfermode* fMode; | 86 SkXfermode* fMode; |
79 | 87 |
80 typedef SkShader INHERITED; | 88 typedef SkShader INHERITED; |
81 }; | 89 }; |
82 | 90 |
83 #endif | 91 #endif |
OLD | NEW |