Use a factory function to create GrPipeline and remove unused member

Review URL: https://codereview.chromium.org/1273803004
This commit is contained in:
bsalomon 2015-08-10 08:23:11 -07:00 committed by Commit bot
parent d22f37cda7
commit 47dfc36e46
2 changed files with 25 additions and 13 deletions

View File

@ -460,13 +460,14 @@ void GrDrawTarget::copySurface(GrSurface* dst,
const GrPipeline* GrDrawTarget::setupPipeline(const PipelineInfo& pipelineInfo,
void* pipelineAddr) {
return SkNEW_PLACEMENT_ARGS(pipelineAddr, GrPipeline, (*pipelineInfo.fPipelineBuilder,
pipelineInfo.fColorPOI,
pipelineInfo.fCoveragePOI,
*this->caps(),
*pipelineInfo.fScissor,
&pipelineInfo.fDstTexture));
return GrPipeline::CreateAt(pipelineAddr, *pipelineInfo.fPipelineBuilder,
pipelineInfo.fColorPOI,
pipelineInfo.fCoveragePOI,
*this->caps(),
*pipelineInfo.fScissor,
&pipelineInfo.fDstTexture);
}
///////////////////////////////////////////////////////////////////////////////
GrDrawTarget::PipelineInfo::PipelineInfo(const GrPipelineBuilder& pipelineBuilder,

View File

@ -29,12 +29,17 @@ class GrPipelineBuilder;
*/
class GrPipeline : public GrNonAtomicRef {
public:
GrPipeline(const GrPipelineBuilder&,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
const GrCaps&,
const GrScissorState&,
const GrXferProcessor::DstTexture*);
/** Creates a pipeline into a pre-allocated buffer */
static GrPipeline* CreateAt(void* memory,
const GrPipelineBuilder& pb,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
const GrCaps& caps,
const GrScissorState& scissor,
const GrXferProcessor::DstTexture* dst) {
return SkNEW_PLACEMENT_ARGS(memory, GrPipeline, (pb, colorPOI, coveragePOI, caps, scissor,
dst));
}
/*
* Returns true if these pipelines are equivalent. Coord transforms may be applied either on
@ -108,6 +113,13 @@ public:
}
private:
GrPipeline(const GrPipelineBuilder&,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
const GrCaps&,
const GrScissorState&,
const GrXferProcessor::DstTexture*);
/**
* Alter the program desc and inputs (attribs and processors) based on the blend optimization.
*/
@ -149,7 +161,6 @@ private:
int fNumColorStages;
SkSTArray<8, const GrCoordTransform*, true> fCoordTransforms;
int fNumCoordTransforms;
GrProgramDesc fDesc;
typedef SkRefCnt INHERITED;