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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, hasMixedSamples)) { |
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, |
216 bool hasMixedSamples) const { | 216 bool hasMixedSamples) const { |
217 return (this->willReadDstColor(caps, optimizations, hasMixedSamples) && | 217 return (this->willReadDstColor(caps, optimizations, hasMixedSamples) && |
218 !caps.shaderCaps()->dstReadInShaderSupport()); | 218 !caps.shaderCaps()->dstReadInShaderSupport()); |
219 } | 219 } |
220 | 220 |
221 bool GrXPFactory::willReadDstColor(const GrCaps& caps, | 221 bool GrXPFactory::willReadDstColor(const GrCaps& caps, |
222 const GrPipelineOptimizations& optimizations, | 222 const GrPipelineOptimizations& optimizations, |
223 bool hasMixedSamples) const { | 223 bool hasMixedSamples) const { |
224 return optimizations.fOverrides.fUsePLSDstRead || this->onWillReadDstColor(c
aps, optimizations, | 224 return optimizations.fOverrides.fUsePLSDstRead || this->onWillReadDstColor(c
aps, optimizations, |
225 h
asMixedSamples); | 225 h
asMixedSamples); |
226 } | 226 } |
OLD | NEW |