| 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 17 matching lines...) Expand all Loading... |
| 28 @param mode The xfermode that combines the colors from the two shade
rs. If mode | 28 @param mode The xfermode that combines the colors from the two shade
rs. If mode |
| 29 is null, then SRC_OVER is assumed. | 29 is null, then SRC_OVER is assumed. |
| 30 */ | 30 */ |
| 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 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, |
| 39 const SkMatrix& viewM, | 39 const SkMatrix& viewM, |
| 40 const SkMatrix* localMatrix, | 40 const SkMatrix* localMatrix, |
| 41 SkFilterQuality, | 41 SkFilterQuality, |
| 42 SkSourceGammaTreatment) cons
t override; | 42 SkSourceGammaTreatment) cons
t override; |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 class ComposeShaderContext : public SkShader::Context { | 45 class ComposeShaderContext : public SkShader::Context { |
| 46 public: | 46 public: |
| 47 // 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 |
| 48 // but it will NOT free the memory. | 48 // but it will NOT free the memory. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 sk_sp<SkShader> fShaderA; | 83 sk_sp<SkShader> fShaderA; |
| 84 sk_sp<SkShader> fShaderB; | 84 sk_sp<SkShader> fShaderB; |
| 85 sk_sp<SkXfermode> fMode; | 85 sk_sp<SkXfermode> fMode; |
| 86 | 86 |
| 87 typedef SkShader INHERITED; | 87 typedef SkShader INHERITED; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif | 90 #endif |
| OLD | NEW |