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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 fClip = clip; | 43 fClip = clip; |
44 | 44 |
45 this->setState(GrPipelineBuilder::kHWAntialias_Flag, | 45 this->setState(GrPipelineBuilder::kHWAntialias_Flag, |
46 rt->isUnifiedMultisampled() && paint.isAntiAlias()); | 46 rt->isUnifiedMultisampled() && paint.isAntiAlias()); |
47 } | 47 } |
48 | 48 |
49 //////////////////////////////////////////////////////////////////////////////s | 49 //////////////////////////////////////////////////////////////////////////////s |
50 | 50 |
51 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, | 51 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, |
52 const GrProcOptInfo& colorPOI, | 52 const GrPipelineOptimizations& opti
mizations) const { |
53 const GrProcOptInfo& coveragePOI) c
onst { | |
54 if (this->getXPFactory()) { | 53 if (this->getXPFactory()) { |
55 return this->getXPFactory()->willNeedDstTexture(caps, colorPOI, coverage
POI, | 54 return this->getXPFactory()->willNeedDstTexture(caps, optimizations, |
56 this->hasMixedSamples())
; | 55 this->hasMixedSamples())
; |
57 } | 56 } |
58 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, colorPOI, cove
ragePOI, | 57 return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, optimizations, |
59 this->hasMixedSample
s()); | 58 this->hasMixedSample
s()); |
60 } | 59 } |
61 | 60 |
62 void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set( | 61 void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set( |
63 const GrPipelineBuilder
* pipelineBuilder) { | 62 const GrPipelineBuilder
* pipelineBuilder) { |
64 if (fPipelineBuilder) { | 63 if (fPipelineBuilder) { |
65 int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt
; | 64 int m = fPipelineBuilder->numColorFragmentProcessors() - fColorEffectCnt
; |
66 SkASSERT(m >= 0); | 65 SkASSERT(m >= 0); |
67 for (int i = 0; i < m; ++i) { | 66 for (int i = 0; i < m; ++i) { |
68 fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref(); | 67 fPipelineBuilder->fColorFragmentProcessors.fromBack(i)->unref(); |
(...skipping 20 matching lines...) Expand all Loading... |
89 | 88 |
90 GrPipelineBuilder::~GrPipelineBuilder() { | 89 GrPipelineBuilder::~GrPipelineBuilder() { |
91 SkASSERT(0 == fBlockEffectRemovalCnt); | 90 SkASSERT(0 == fBlockEffectRemovalCnt); |
92 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { | 91 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { |
93 fColorFragmentProcessors[i]->unref(); | 92 fColorFragmentProcessors[i]->unref(); |
94 } | 93 } |
95 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { | 94 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { |
96 fCoverageFragmentProcessors[i]->unref(); | 95 fCoverageFragmentProcessors[i]->unref(); |
97 } | 96 } |
98 } | 97 } |
OLD | NEW |