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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 SkASSERT(effect); | 77 SkASSERT(effect); |
78 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (effect)); | 78 SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (effect)); |
79 fCoverageProcInfoValid = false; | 79 fCoverageProcInfoValid = false; |
80 return effect; | 80 return effect; |
81 } | 81 } |
82 | 82 |
83 /** | 83 /** |
84 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. | 84 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. |
85 */ | 85 */ |
86 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { | 86 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { |
87 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))-
>unref(); | 87 this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager,
texture, |
| 88 matrix))->unref(); |
88 } | 89 } |
89 | 90 |
90 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix)
{ | 91 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix)
{ |
91 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix
))->unref(); | 92 this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManag
er, texture, |
| 93 matrix))->unref
(); |
92 } | 94 } |
93 | 95 |
94 void addColorTextureProcessor(GrTexture* texture, | 96 void addColorTextureProcessor(GrTexture* texture, |
95 const SkMatrix& matrix, | 97 const SkMatrix& matrix, |
96 const GrTextureParams& params) { | 98 const GrTextureParams& params) { |
97 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix, p
arams))->unref(); | 99 this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager,
texture, matrix, |
| 100 params))->unref(); |
98 } | 101 } |
99 | 102 |
100 void addCoverageTextureProcessor(GrTexture* texture, | 103 void addCoverageTextureProcessor(GrTexture* texture, |
101 const SkMatrix& matrix, | 104 const SkMatrix& matrix, |
102 const GrTextureParams& params) { | 105 const GrTextureParams& params) { |
103 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix
, params))->unref(); | 106 this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManag
er, texture, matrix, |
| 107 params))->unref
(); |
104 } | 108 } |
105 | 109 |
106 /** | 110 /** |
107 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder | 111 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder |
108 * that were added after its constructor. | 112 * that were added after its constructor. |
109 */ | 113 */ |
110 class AutoRestoreFragmentProcessors : public ::SkNoncopyable { | 114 class AutoRestoreFragmentProcessors : public ::SkNoncopyable { |
111 public: | 115 public: |
112 AutoRestoreFragmentProcessors() | 116 AutoRestoreFragmentProcessors() |
113 : fPipelineBuilder(NULL) | 117 : fPipelineBuilder(NULL) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 mutable GrProcOptInfo fCoverageProcInfo; | 452 mutable GrProcOptInfo fCoverageProcInfo; |
449 mutable bool fColorProcInfoValid; | 453 mutable bool fColorProcInfoValid; |
450 mutable bool fCoverageProcInfoValid; | 454 mutable bool fCoverageProcInfoValid; |
451 mutable GrColor fColorCache; | 455 mutable GrColor fColorCache; |
452 mutable GrColor fCoverageCache; | 456 mutable GrColor fCoverageCache; |
453 | 457 |
454 friend class GrPipeline; | 458 friend class GrPipeline; |
455 }; | 459 }; |
456 | 460 |
457 #endif | 461 #endif |
OLD | NEW |