| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkColorFilterShader_DEFINED | 8 #ifndef SkColorFilterShader_DEFINED |
| 9 #define SkColorFilterShader_DEFINED | 9 #define SkColorFilterShader_DEFINED |
| 10 | 10 |
| 11 #include "SkColorFilter.h" | 11 #include "SkColorFilter.h" |
| 12 #include "SkShader.h" | 12 #include "SkShader.h" |
| 13 | 13 |
| 14 class SkColorFilterShader : public SkShader { | 14 class SkColorFilterShader : public SkShader { |
| 15 public: | 15 public: |
| 16 SkColorFilterShader(sk_sp<SkShader> shader, sk_sp<SkColorFilter> filter); | 16 SkColorFilterShader(sk_sp<SkShader> shader, sk_sp<SkColorFilter> filter); |
| 17 | 17 |
| 18 #if SK_SUPPORT_GPU | 18 #if SK_SUPPORT_GPU |
| 19 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, | 19 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri
de; |
| 20 const SkMatrix& viewM, | |
| 21 const SkMatrix* localMatrix, | |
| 22 SkFilterQuality, | |
| 23 SkSourceGammaTreatment) const
override; | |
| 24 #endif | 20 #endif |
| 25 | 21 |
| 26 class FilterShaderContext : public SkShader::Context { | 22 class FilterShaderContext : public SkShader::Context { |
| 27 public: | 23 public: |
| 28 // Takes ownership of shaderContext and calls its destructor. | 24 // Takes ownership of shaderContext and calls its destructor. |
| 29 FilterShaderContext(const SkColorFilterShader&, SkShader::Context*, cons
t ContextRec&); | 25 FilterShaderContext(const SkColorFilterShader&, SkShader::Context*, cons
t ContextRec&); |
| 30 virtual ~FilterShaderContext(); | 26 virtual ~FilterShaderContext(); |
| 31 | 27 |
| 32 uint32_t getFlags() const override; | 28 uint32_t getFlags() const override; |
| 33 | 29 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 54 Context* onCreateContext(const ContextRec&, void* storage) const override; | 50 Context* onCreateContext(const ContextRec&, void* storage) const override; |
| 55 | 51 |
| 56 private: | 52 private: |
| 57 sk_sp<SkShader> fShader; | 53 sk_sp<SkShader> fShader; |
| 58 sk_sp<SkColorFilter> fFilter; | 54 sk_sp<SkColorFilter> fFilter; |
| 59 | 55 |
| 60 typedef SkShader INHERITED; | 56 typedef SkShader INHERITED; |
| 61 }; | 57 }; |
| 62 | 58 |
| 63 #endif | 59 #endif |
| OLD | NEW |