Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: src/gpu/GrOptDrawState.h

Issue 777673003: move program descriptor generation to flush (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index 542172fd642e032135ea6502de24e08d7f755790..46aa3134a425e4410848d07e446c2a134b8d6345 100644
--- a/src/gpu/GrOptDrawState.h
+++ b/src/gpu/GrOptDrawState.h
@@ -30,7 +30,7 @@ public:
typedef GrClipMaskManager::ScissorState ScissorState;
- GrOptDrawState(const GrDrawState& drawState, GrGpu*, const ScissorState&,
+ GrOptDrawState(const GrDrawState& drawState, const GrDrawTargetCaps&, const ScissorState&,
const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType);
bool operator== (const GrOptDrawState& that) const;
@@ -179,7 +179,7 @@ public:
const GrDeviceCoordTexture* getDstCopy() const { return fDstCopy.texture() ? &fDstCopy : NULL; }
- const GrProgramDesc& programDesc() const { return fDesc; }
+ const GrProgramDesc::DescInfo& descInfo() const { return fDescInfo; }
private:
/**
@@ -188,22 +188,20 @@ private:
* stages. In the constant color case, we can ignore all previous stages and
* the current one and set the state color to the constant color.
*/
- void computeEffectiveColorStages(const GrDrawState& ds, GrProgramDesc::DescInfo*,
- int* firstColorStageIdx, uint8_t* fixFunctionVAToRemove);
+ void computeEffectiveColorStages(const GrDrawState& ds, int* firstColorStageIdx,
+ uint8_t* fixFunctionVAToRemove);
/**
* Loops through all the coverage stage effects to check if the stage will ignore color input.
* If a coverage stage will ignore input, then we can ignore all coverage stages before it. We
* loop to determine the first effective coverage stage.
*/
- void computeEffectiveCoverageStages(const GrDrawState& ds, GrProgramDesc::DescInfo* descInfo,
- int* firstCoverageStageIdx);
+ void computeEffectiveCoverageStages(const GrDrawState& ds, int* firstCoverageStageIdx);
/**
* Alter the program desc and inputs (attribs and processors) based on the blend optimization.
*/
void adjustProgramForBlendOpt(const GrDrawState& ds, GrDrawState::BlendOpt,
- GrProgramDesc::DescInfo*,
int* firstColorStageIdx, int* firstCoverageStageIdx);
/**
@@ -211,15 +209,14 @@ private:
* shaders they require.
*/
void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstCoverageStageIdx,
- bool hasLocalCoords, GrProgramDesc::DescInfo*);
+ bool hasLocalCoords);
/**
* Calculates the primary and secondary output types of the shader. For certain output types
* the function may adjust the blend coefficients. After this function is called the src and dst
* blend coeffs will represent those used by backend API.
*/
- void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const GrDrawTargetCaps&,
- GrProgramDesc::DescInfo*);
+ void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const GrDrawTargetCaps&);
enum Flags {
kDither_Flag = 0x1,
@@ -244,12 +241,11 @@ private:
uint32_t fFlags;
ProgramGeometryProcessor fGeometryProcessor;
FragmentStageArray fFragmentStages;
+ GrProgramDesc::DescInfo fDescInfo;
// This function is equivalent to the offset into fFragmentStages where coverage stages begin.
int fNumColorStages;
- GrProgramDesc fDesc;
-
typedef SkRefCnt INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698