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 10 matching lines...) Expand all Loading... |
21 bool willReadDstColor, | 21 bool willReadDstColor, |
22 bool hasMixedSamples) | 22 bool hasMixedSamples) |
23 : fWillReadDstColor(willReadDstColor) | 23 : fWillReadDstColor(willReadDstColor) |
24 , fDstReadUsesMixedSamples(willReadDstColor && hasMixedSamples) | 24 , fDstReadUsesMixedSamples(willReadDstColor && hasMixedSamples) |
25 , fDstTextureOffset() { | 25 , fDstTextureOffset() { |
26 if (dstTexture && dstTexture->texture()) { | 26 if (dstTexture && dstTexture->texture()) { |
27 SkASSERT(willReadDstColor); | 27 SkASSERT(willReadDstColor); |
28 fDstTexture.reset(dstTexture->texture()); | 28 fDstTexture.reset(dstTexture->texture()); |
29 fDstTextureOffset = dstTexture->offset(); | 29 fDstTextureOffset = dstTexture->offset(); |
30 this->addTextureAccess(&fDstTexture); | 30 this->addTextureAccess(&fDstTexture); |
31 this->setWillReadFragmentPosition(); | 31 this->enableBuiltInState(kFragmentPosition_BuiltInState); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 GrXferProcessor::OptFlags GrXferProcessor::getOptimizations( | 35 GrXferProcessor::OptFlags GrXferProcessor::getOptimizations( |
36 const GrPipelineOptimizat
ions& optimizations, | 36 const GrPipelineOptimizat
ions& optimizations, |
37 bool doesStencilWrite, | 37 bool doesStencilWrite, |
38 GrColor* overrideColor, | 38 GrColor* overrideColor, |
39 const GrCaps& caps) const
{ | 39 const GrCaps& caps) const
{ |
40 GrXferProcessor::OptFlags flags = this->onGetOptimizations(optimizations, | 40 GrXferProcessor::OptFlags flags = this->onGetOptimizations(optimizations, |
41 doesStencilWrite, | 41 doesStencilWrite, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |