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 #include "GrXferProcessor.h" | 8 #include "GrXferProcessor.h" |
9 #include "GrPipeline.h" | 9 #include "GrPipeline.h" |
10 #include "GrPipelineBuilder.h" | 10 #include "GrPipelineBuilder.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 #endif | 191 #endif |
192 | 192 |
193 /////////////////////////////////////////////////////////////////////////////// | 193 /////////////////////////////////////////////////////////////////////////////// |
194 | 194 |
195 GrXferProcessor* GrXPFactory::createXferProcessor(const GrPipelineOptimizations&
optimizations, | 195 GrXferProcessor* GrXPFactory::createXferProcessor(const GrPipelineOptimizations&
optimizations, |
196 bool hasMixedSamples, | 196 bool hasMixedSamples, |
197 const DstTexture* dstTexture, | 197 const DstTexture* dstTexture, |
198 const GrCaps& caps) const { | 198 const GrCaps& caps) const { |
199 #ifdef SK_DEBUG | 199 #ifdef SK_DEBUG |
200 if (this->willReadDstColor(caps, optimizations, hasMixedSamples)) { | 200 if (this->willReadDstColor(caps, optimizations)) { |
201 if (!caps.shaderCaps()->dstReadInShaderSupport()) { | 201 if (!caps.shaderCaps()->dstReadInShaderSupport()) { |
202 SkASSERT(dstTexture && dstTexture->texture()); | 202 SkASSERT(dstTexture && dstTexture->texture()); |
203 } else { | 203 } else { |
204 SkASSERT(!dstTexture || !dstTexture->texture()); | 204 SkASSERT(!dstTexture || !dstTexture->texture()); |
205 } | 205 } |
206 } else { | 206 } else { |
207 SkASSERT(!dstTexture || !dstTexture->texture()); | 207 SkASSERT(!dstTexture || !dstTexture->texture()); |
208 } | 208 } |
209 SkASSERT(!hasMixedSamples || caps.shaderCaps()->dualSourceBlendingSupport())
; | 209 SkASSERT(!hasMixedSamples || caps.shaderCaps()->dualSourceBlendingSupport())
; |
210 #endif | 210 #endif |
211 return this->onCreateXferProcessor(caps, optimizations, hasMixedSamples, dst
Texture); | 211 return this->onCreateXferProcessor(caps, optimizations, hasMixedSamples, dst
Texture); |
212 } | 212 } |
213 | 213 |
214 bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, | 214 bool GrXPFactory::willNeedDstTexture(const GrCaps& caps, |
215 const GrPipelineOptimizations& optimization
s, | 215 const GrPipelineOptimizations& optimization
s) const { |
216 bool hasMixedSamples) const { | 216 return (this->willReadDstColor(caps, optimizations) && |
217 return (this->willReadDstColor(caps, optimizations, hasMixedSamples) && | |
218 !caps.shaderCaps()->dstReadInShaderSupport()); | 217 !caps.shaderCaps()->dstReadInShaderSupport()); |
219 } | 218 } |
220 | 219 |
221 bool GrXPFactory::willReadDstColor(const GrCaps& caps, | 220 bool GrXPFactory::willReadDstColor(const GrCaps& caps, |
222 const GrPipelineOptimizations& optimizations, | 221 const GrPipelineOptimizations& optimizations)
const { |
223 bool hasMixedSamples) const { | 222 return optimizations.fOverrides.fUsePLSDstRead || this->onWillReadDstColor(c
aps, optimizations); |
224 return optimizations.fOverrides.fUsePLSDstRead || this->onWillReadDstColor(c
aps, optimizations, | |
225 h
asMixedSamples); | |
226 } | 223 } |
OLD | NEW |