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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 const GrFragmentProcessor* addCoverageFragmentProcessor(const GrFragmentProc
essor* processor) { | 72 const GrFragmentProcessor* addCoverageFragmentProcessor(const GrFragmentProc
essor* processor) { |
73 SkASSERT(processor); | 73 SkASSERT(processor); |
74 fCoverageFragmentProcessors.push_back(SkRef(processor)); | 74 fCoverageFragmentProcessors.push_back(SkRef(processor)); |
75 return processor; | 75 return processor; |
76 } | 76 } |
77 | 77 |
78 /** | 78 /** |
79 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. | 79 * Creates a GrSimpleTextureEffect that uses local coords as texture coordin
ates. |
80 */ | 80 */ |
81 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { | 81 void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix, Gr
RenderTarget* dst) { |
82 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, m
atrix))->unref(); | 82 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, |
| 83 matrix, kL
ocal_GrCoordSet, dst))->unref(); |
83 } | 84 } |
84 | 85 |
85 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix)
{ | 86 void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix,
GrRenderTarget* dst) { |
86 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(texture
, matrix))->unref(); | 87 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(texture
, |
| 88 matrix,
kLocal_GrCoordSet, dst))->unref(); |
87 } | 89 } |
88 | 90 |
89 void addColorTextureProcessor(GrTexture* texture, | 91 void addColorTextureProcessor(GrTexture* texture, |
90 const SkMatrix& matrix, | 92 const SkMatrix& matrix, |
91 const GrTextureParams& params) { | 93 const GrTextureParams& params, GrRenderTarget*
dst) { |
92 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, m
atrix, | 94 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, |
93 params))->
unref(); | 95 matrix, |
| 96 params, kL
ocal_GrCoordSet, dst))->unref(); |
94 } | 97 } |
95 | 98 |
96 void addCoverageTextureProcessor(GrTexture* texture, | 99 void addCoverageTextureProcessor(GrTexture* texture, |
97 const SkMatrix& matrix, | 100 const SkMatrix& matrix, |
98 const GrTextureParams& params) { | 101 const GrTextureParams& params, GrRenderTarg
et* dst) { |
99 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(texture
, matrix, | 102 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(texture
, |
100 params)
)->unref(); | 103 matrix,
params, kLocal_GrCoordSet, dst))->unref(); |
101 } | 104 } |
102 | 105 |
103 /** | 106 /** |
104 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder | 107 * When this object is destroyed it will remove any color/coverage FPs from
the pipeline builder |
105 * that were added after its constructor. | 108 * that were added after its constructor. |
106 * This class can transiently modify its "const" GrPipelineBuilder object bu
t will restore it | 109 * This class can transiently modify its "const" GrPipelineBuilder object bu
t will restore it |
107 * when done - so it is notionally "const" correct. | 110 * when done - so it is notionally "const" correct. |
108 */ | 111 */ |
109 class AutoRestoreFragmentProcessorState : public ::SkNoncopyable { | 112 class AutoRestoreFragmentProcessorState : public ::SkNoncopyable { |
110 public: | 113 public: |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 FragmentProcessorArray fCoverageFragmentProcessors; | 407 FragmentProcessorArray fCoverageFragmentProcessors; |
405 GrClip fClip; | 408 GrClip fClip; |
406 | 409 |
407 mutable GrProcOptInfo fColorProcInfo; | 410 mutable GrProcOptInfo fColorProcInfo; |
408 mutable GrProcOptInfo fCoverageProcInfo; | 411 mutable GrProcOptInfo fCoverageProcInfo; |
409 | 412 |
410 friend class GrPipeline; | 413 friend class GrPipeline; |
411 }; | 414 }; |
412 | 415 |
413 #endif | 416 #endif |
OLD | NEW |