OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkComposeShader_DEFINED | 8 #ifndef SkComposeShader_DEFINED |
9 #define SkComposeShader_DEFINED | 9 #define SkComposeShader_DEFINED |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, sk_sp<SkXfermode> mo
de) | 31 SkComposeShader(sk_sp<SkShader> sA, sk_sp<SkShader> sB, sk_sp<SkXfermode> mo
de) |
32 : fShaderA(std::move(sA)) | 32 : fShaderA(std::move(sA)) |
33 , fShaderB(std::move(sB)) | 33 , fShaderB(std::move(sB)) |
34 , fMode(std::move(mode)) | 34 , fMode(std::move(mode)) |
35 {} | 35 {} |
36 | 36 |
37 #if SK_SUPPORT_GPU | 37 #if SK_SUPPORT_GPU |
38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, | 38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, |
39 const SkMatrix& viewM, | 39 const SkMatrix& viewM, |
40 const SkMatrix* localMatrix, | 40 const SkMatrix* localMatrix, |
41 SkFilterQuality) const overr
ide; | 41 SkFilterQuality, |
| 42 SkSourceGammaTreatment) cons
t override; |
42 #endif | 43 #endif |
43 | 44 |
44 class ComposeShaderContext : public SkShader::Context { | 45 class ComposeShaderContext : public SkShader::Context { |
45 public: | 46 public: |
46 // When this object gets destroyed, it will call contextA and contextB's
destructor | 47 // When this object gets destroyed, it will call contextA and contextB's
destructor |
47 // but it will NOT free the memory. | 48 // but it will NOT free the memory. |
48 ComposeShaderContext(const SkComposeShader&, const ContextRec&, | 49 ComposeShaderContext(const SkComposeShader&, const ContextRec&, |
49 SkShader::Context* contextA, SkShader::Context* con
textB); | 50 SkShader::Context* contextA, SkShader::Context* con
textB); |
50 | 51 |
51 SkShader::Context* getShaderContextA() const { return fShaderContextA; } | 52 SkShader::Context* getShaderContextA() const { return fShaderContextA; } |
(...skipping 28 matching lines...) Expand all Loading... |
80 | 81 |
81 private: | 82 private: |
82 sk_sp<SkShader> fShaderA; | 83 sk_sp<SkShader> fShaderA; |
83 sk_sp<SkShader> fShaderB; | 84 sk_sp<SkShader> fShaderB; |
84 sk_sp<SkXfermode> fMode; | 85 sk_sp<SkXfermode> fMode; |
85 | 86 |
86 typedef SkShader INHERITED; | 87 typedef SkShader INHERITED; |
87 }; | 88 }; |
88 | 89 |
89 #endif | 90 #endif |
OLD | NEW |