OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrPipelineBuilder_DEFINED | 8 #ifndef GrPipelineBuilder_DEFINED |
9 #define GrPipelineBuilder_DEFINED | 9 #define GrPipelineBuilder_DEFINED |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 void addCoverageFragmentProcessor(sk_sp<GrFragmentProcessor> processor) { | 71 void addCoverageFragmentProcessor(sk_sp<GrFragmentProcessor> processor) { |
72 SkASSERT(processor); | 72 SkASSERT(processor); |
73 fCoverageFragmentProcessors.push_back(std::move(processor)); | 73 fCoverageFragmentProcessors.push_back(std::move(processor)); |
74 } | 74 } |
75 | 75 |
76 /** | 76 /** |
77 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. | 77 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. |
78 */ | 78 */ |
79 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { | 79 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { |
80 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, mat
rix)); | 80 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, nul
lptr, matrix)); |
81 } | 81 } |
82 | 82 |
83 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix)
{ | 83 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix)
{ |
84 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture,
matrix)); | 84 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture,
nullptr, matrix)); |
85 } | 85 } |
86 | 86 |
87 void addColorTextureProcessor(GrTexture* texture, | 87 void addColorTextureProcessor(GrTexture* texture, |
88 const SkMatrix& matrix, | 88 const SkMatrix& matrix, |
89 const GrTextureParams& params) { | 89 const GrTextureParams& params) { |
90 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, mat
rix, params)); | 90 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, nul
lptr, matrix, |
| 91 params)); |
91 } | 92 } |
92 | 93 |
93 void addCoverageTextureProcessor(GrTexture* texture, | 94 void addCoverageTextureProcessor(GrTexture* texture, |
94 const SkMatrix& matrix, | 95 const SkMatrix& matrix, |
95 const GrTextureParams& params) { | 96 const GrTextureParams& params) { |
96 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture,
matrix, params)); | 97 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture,
nullptr, matrix, |
| 98 params)); |
97 } | 99 } |
98 | 100 |
99 /** | 101 /** |
100 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder | 102 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder |
101 * that were added after its constructor. | 103 * that were added after its constructor. |
102 * This class can transiently modify its "const" GrPipelineBuilder object bu
t will restore it | 104 * This class can transiently modify its "const" GrPipelineBuilder object bu
t will restore it |
103 * when done - so it is notionally "const" correct. | 105 * when done - so it is notionally "const" correct. |
104 */ | 106 */ |
105 class AutoRestoreFragmentProcessorState : public ::SkNoncopyable { | 107 class AutoRestoreFragmentProcessorState : public ::SkNoncopyable { |
106 public: | 108 public: |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 DrawFace fDrawFace; | 308 DrawFace fDrawFace; |
307 mutable sk_sp<GrXPFactory> fXPFactory; | 309 mutable sk_sp<GrXPFactory> fXPFactory; |
308 FragmentProcessorArray fColorFragmentProcessors; | 310 FragmentProcessorArray fColorFragmentProcessors; |
309 FragmentProcessorArray fCoverageFragmentProcessors; | 311 FragmentProcessorArray fCoverageFragmentProcessors; |
310 | 312 |
311 friend class GrPipeline; | 313 friend class GrPipeline; |
312 friend class GrDrawTarget; | 314 friend class GrDrawTarget; |
313 }; | 315 }; |
314 | 316 |
315 #endif | 317 #endif |
OLD | NEW |