Index: src/gpu/GrPipelineBuilder.cpp |
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp |
index ab185505d6e3504f728f4d83618b78fd68335977..ce465c1c711dd3c216bd2ac644b16ae96ca9221d 100644 |
--- a/src/gpu/GrPipelineBuilder.cpp |
+++ b/src/gpu/GrPipelineBuilder.cpp |
@@ -31,7 +31,7 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c |
fCoverageFragmentProcessors.push_back(SkRef(paint.getCoverageFragmentProcessor(i))); |
} |
- fXPFactory.reset(SkRef(paint.getXPFactory())); |
+ fXPFactory.reset(SkSafeRef(paint.getXPFactory())); |
this->setRenderTarget(rt); |
@@ -51,8 +51,12 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c |
bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, |
const GrProcOptInfo& colorPOI, |
const GrProcOptInfo& coveragePOI) const { |
- return this->getXPFactory()->willNeedDstTexture(caps, colorPOI, coveragePOI, |
- this->hasMixedSamples()); |
+ if (this->getXPFactory()) { |
+ return this->getXPFactory()->willNeedDstTexture(caps, colorPOI, coveragePOI, |
+ this->hasMixedSamples()); |
+ } |
+ return GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(caps, colorPOI, coveragePOI, |
+ this->hasMixedSamples()); |
} |
void GrPipelineBuilder::AutoRestoreFragmentProcessorState::set( |