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

Unified Diff: src/gpu/GrOptDrawState.h

Issue 674543004: OptState owns program descriptor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months 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 f47913a41ae049b2b214ac166a1291f4c09bf3a2..2be301706d3648df4c02560ba6355ff71fb34476 100644
--- a/src/gpu/GrOptDrawState.h
+++ b/src/gpu/GrOptDrawState.h
@@ -11,11 +11,13 @@
#include "GrColor.h"
#include "GrGpu.h"
#include "GrProcessorStage.h"
+#include "GrProgramDesc.h"
#include "GrStencil.h"
#include "GrTypesPriv.h"
#include "SkMatrix.h"
#include "SkRefCnt.h"
+class GrDeviceCoordTexture;
class GrDrawState;
/**
@@ -30,8 +32,8 @@ public:
* GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership is given to the
* caller.
*/
- static GrOptDrawState* Create(const GrDrawState& drawState, const GrDrawTargetCaps& caps,
- GrGpu::DrawType drawType);
+ static GrOptDrawState* Create(const GrDrawState& drawState, GrGpu*,
+ const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType drawType);
bool operator== (const GrOptDrawState& that) const;
@@ -306,38 +308,10 @@ public:
bool readsFragPosition() const { return fReadsFragPosition; }
bool requiresLocalCoordAttrib() const { return fRequiresLocalCoordAttrib; }
- ///////////////////////////////////////////////////////////////////////////
- /// @name Stage Output Types
- ////
-
- enum PrimaryOutputType {
- // Modulate color and coverage, write result as the color output.
- kModulate_PrimaryOutputType,
- // Combines the coverage, dst, and color as coverage * color + (1 - coverage) * dst. This
- // can only be set if fDstReadKey is non-zero.
- kCombineWithDst_PrimaryOutputType,
-
- kPrimaryOutputTypeCnt,
- };
-
- enum SecondaryOutputType {
- // There is no secondary output
- kNone_SecondaryOutputType,
- // Writes coverage as the secondary output. Only set if dual source blending is supported
- // and primary output is kModulate.
- kCoverage_SecondaryOutputType,
- // Writes coverage * (1 - colorA) as the secondary output. Only set if dual source blending
- // is supported and primary output is kModulate.
- kCoverageISA_SecondaryOutputType,
- // Writes coverage * (1 - colorRGBA) as the secondary output. Only set if dual source
- // blending is supported and primary output is kModulate.
- kCoverageISC_SecondaryOutputType,
-
- kSecondaryOutputTypeCnt,
- };
+ GrProgramDesc::PrimaryOutputType getPrimaryOutputType() const { return fPrimaryOutputType; }
+ GrProgramDesc::SecondaryOutputType getSecondaryOutputType() const { return fSecondaryOutputType; }
- PrimaryOutputType getPrimaryOutputType() const { return fPrimaryOutputType; }
- SecondaryOutputType getSecondaryOutputType() const { return fSecondaryOutputType; }
+ const GrProgramDesc& desc() const { return fDesc; }
/// @}
@@ -376,7 +350,7 @@ private:
*/
GrOptDrawState(const GrDrawState& drawState, BlendOptFlags blendOptFlags,
GrBlendCoeff optSrcCoeff, GrBlendCoeff optDstCoeff,
- const GrDrawTargetCaps& caps);
+ GrGpu*, const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType);
/**
* Loops through all the color stage effects to check if the stage will ignore color input or
@@ -467,8 +441,10 @@ private:
BlendOptFlags fBlendOptFlags;
// Fragment shader color outputs
- PrimaryOutputType fPrimaryOutputType : 8;
- SecondaryOutputType fSecondaryOutputType : 8;
+ GrProgramDesc::PrimaryOutputType fPrimaryOutputType : 8;
bsalomon 2014/10/23 17:08:52 Is this stuff part of the key already? Wondering i
egdaniel 2014/10/23 17:15:07 An option would be to store these values locally i
joshualitt 2014/10/23 17:45:06 Seems a bit icky. We calculate these types while
egdaniel 2014/10/23 17:53:02 I don't think it is that wacky. The only reason we
bsalomon 2014/10/23 18:10:29 I'm not sure about the actual mechanics but I agre
+ GrProgramDesc::SecondaryOutputType fSecondaryOutputType : 8;
+
+ GrProgramDesc fDesc;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrOptDrawState.cpp » ('j') | src/gpu/gl/GrGpuGL.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698