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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 paint.getDisableOutputConversionToSRGB()); | 48 paint.getDisableOutputConversionToSRGB()); |
49 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag, | 49 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag, |
50 paint.getAllowSRGBInputs()); | 50 paint.getAllowSRGBInputs()); |
51 } | 51 } |
52 | 52 |
53 //////////////////////////////////////////////////////////////////////////////s | 53 //////////////////////////////////////////////////////////////////////////////s |
54 | 54 |
55 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, | 55 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, |
56 const GrPipelineOptimizations& opti
mizations) const { | 56 const GrPipelineOptimizations& opti
mizations) const { |
57 if (this->getXPFactory()) { | 57 if (this->getXPFactory()) { |
58 return this->getXPFactory()->willNeedDstTexture(caps, optimizations, | 58 return this->getXPFactory()->willNeedDstTexture(caps, optimizations); |
59 this->hasMixedSamples())
; | |
60 } | 59 } |
61 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations, | 60 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations)
; |
62 this->hasMixedSample
s()); | |
63 } | 61 } |
64 | 62 |
65 void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set( | 63 void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set( |
66 const GrPipelineBuilder
* pipelineBuilder) { | 64 const GrPipelineBuilder
* pipelineBuilder) { |
67 if (fPipelineBuilder) { | 65 if (fPipelineBuilder) { |
68 int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt
; | 66 int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt
; |
69 SkASSERT(m >= 0); | 67 SkASSERT(m >= 0); |
70 for (int i = 0; i < m; ++i) { | 68 for (int i = 0; i < m; ++i) { |
71 fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref(); | 69 fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref(); |
72 } | 70 } |
(...skipping 19 matching lines...) Expand all Loading... |
92 | 90 |
93 GrPipelineBuilder::~GrPipelineBuilder() { | 91 GrPipelineBuilder::~GrPipelineBuilder() { |
94 SkASSERT(0 == fBlockEffectRemovalCnt); | 92 SkASSERT(0 == fBlockEffectRemovalCnt); |
95 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { | 93 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { |
96 fColorFragmentProcessors[i]->unref(); | 94 fColorFragmentProcessors[i]->unref(); |
97 } | 95 } |
98 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { | 96 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { |
99 fCoverageFragmentProcessors[i]->unref(); | 97 fCoverageFragmentProcessors[i]->unref(); |
100 } | 98 } |
101 } | 99 } |
OLD | NEW |