| 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 "GrPipelineBuilder.h" | 8 #include "GrPipelineBuilder.h" |
| 9 | 9 |
| 10 #include "GrBlend.h" | 10 #include "GrBlend.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 fCoverageFragmentProcessors.emplace_back(SkRef(paint.getCoverageFragment
Processor(i))); | 34 fCoverageFragmentProcessors.emplace_back(SkRef(paint.getCoverageFragment
Processor(i))); |
| 35 } | 35 } |
| 36 | 36 |
| 37 fXPFactory.reset(SkSafeRef(paint.getXPFactory())); | 37 fXPFactory.reset(SkSafeRef(paint.getXPFactory())); |
| 38 | 38 |
| 39 this->setState(GrPipelineBuilder::kHWAntialias_Flag, useHWAA); | 39 this->setState(GrPipelineBuilder::kHWAntialias_Flag, useHWAA); |
| 40 this->setState(GrPipelineBuilder::kDisableOutputConversionToSRGB_Flag, | 40 this->setState(GrPipelineBuilder::kDisableOutputConversionToSRGB_Flag, |
| 41 paint.getDisableOutputConversionToSRGB()); | 41 paint.getDisableOutputConversionToSRGB()); |
| 42 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag, | 42 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag, |
| 43 paint.getAllowSRGBInputs()); | 43 paint.getAllowSRGBInputs()); |
| 44 this->setState(GrPipelineBuilder::kUsesDistanceVectorField_Flag, |
| 45 paint.usesDistanceVectorField()); |
| 44 } | 46 } |
| 45 | 47 |
| 46 //////////////////////////////////////////////////////////////////////////////s | 48 //////////////////////////////////////////////////////////////////////////////s |
| 47 | 49 |
| 48 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, | 50 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, |
| 49 const GrPipelineOptimizations& opti
mizations) const { | 51 const GrPipelineOptimizations& opti
mizations) const { |
| 50 if (this->getXPFactory()) { | 52 if (this->getXPFactory()) { |
| 51 return this->getXPFactory()->willNeedDstTexture(caps, optimizations); | 53 return this->getXPFactory()->willNeedDstTexture(caps, optimizations); |
| 52 } | 54 } |
| 53 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations)
; | 55 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations)
; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentProcessors(); | 74 fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentProcessors(); |
| 73 SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;) | 75 SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;) |
| 74 } | 76 } |
| 75 } | 77 } |
| 76 | 78 |
| 77 //////////////////////////////////////////////////////////////////////////////// | 79 //////////////////////////////////////////////////////////////////////////////// |
| 78 | 80 |
| 79 GrPipelineBuilder::~GrPipelineBuilder() { | 81 GrPipelineBuilder::~GrPipelineBuilder() { |
| 80 SkASSERT(0 == fBlockEffectRemovalCnt); | 82 SkASSERT(0 == fBlockEffectRemovalCnt); |
| 81 } | 83 } |
| OLD | NEW |