diff options
author | 2015-01-28 06:54:30 -0800 | |
---|---|---|
committer | 2015-01-28 06:54:30 -0800 | |
commit | c2893c5e3870d7e9a37ca146e7da88fba54977d5 (patch) | |
tree | 9efd98166a608e5ae24d35ab0dde1c7cb9b763b3 /src/gpu/GrGeometryProcessor.h | |
parent | 8b0a05ae44911f9263be5936457b66a967b8a1fc (diff) |
Revert of GrBatchPrototype (patchset #32 id:630001 of https://codereview.chromium.org/845103005/)
Reason for revert:
One last try to fix mac perf regression
Original issue's description:
> GrBatchPrototype
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d15e4e45374275c045572b304c229237c4a82be4
>
> Committed: https://skia.googlesource.com/skia/+/d5a7db4a867c7e6ccf8451a053d987b470099198
TBR=bsalomon@google.com,kkinnunen@nvidia.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/877393002
Diffstat (limited to 'src/gpu/GrGeometryProcessor.h')
-rw-r--r-- | src/gpu/GrGeometryProcessor.h | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h index a7fea765ab..c55b9afc79 100644 --- a/src/gpu/GrGeometryProcessor.h +++ b/src/gpu/GrGeometryProcessor.h @@ -9,6 +9,7 @@ #define GrGeometryProcessor_DEFINED #include "GrColor.h" +#include "GrGeometryData.h" #include "GrProcessor.h" #include "GrShaderVar.h" @@ -45,8 +46,6 @@ /* * A struct for tracking batching decisions. While this lives on GrOptState, it is managed * entirely by the derived classes of the GP. - * // TODO this was an early attempt at handling out of order batching. It should be - * used carefully as it is being replaced by GrBatch */ class GrBatchTracker { public: @@ -66,24 +65,12 @@ private: SkAlignedSStorage<kMaxSize> fData; }; -class GrIndexBufferAllocPool; class GrGLCaps; class GrGLPrimitiveProcessor; -class GrVertexBufferAllocPool; +class GrOptDrawState; struct GrInitInvariantOutput; -/* - * This struct allows the GrPipeline to communicate information about the pipeline. Most of this - * is overrides, but some of it is general information. Logically it should live in GrPipeline.h, - * but this is problematic due to circular dependencies. - */ -struct GrPipelineInfo { - bool fColorIgnored; - bool fCoverageIgnored; - GrColor fOverrideColor; - bool fUsesLocalCoords; -}; /* * This enum is shared by GrPrimitiveProcessors and GrGLPrimitiveProcessors to coordinate shaders @@ -108,7 +95,17 @@ public: const SkMatrix& viewMatrix() const { return fViewMatrix; } const SkMatrix& localMatrix() const { return fLocalMatrix; } - virtual void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const = 0; + /* + * This struct allows the optstate to communicate requirements to the GrPrimitiveProcessor. + */ + struct InitBT { + bool fColorIgnored; + bool fCoverageIgnored; + GrColor fOverrideColor; + bool fUsesLocalCoords; + }; + + virtual void initBatchTracker(GrBatchTracker*, const InitBT&) const = 0; virtual bool canMakeEqual(const GrBatchTracker& mine, const GrPrimitiveProcessor& that, @@ -307,8 +304,7 @@ protected: * TODO this function changes quite a bit with deferred geometry. There the GrGeometryProcessor * can upload a new color via attribute if needed. */ - static GrGPInput GetColorInputType(GrColor* color, GrColor primitiveColor, - const GrPipelineInfo& init, + static GrGPInput GetColorInputType(GrColor* color, GrColor primitiveColor, const InitBT& init, bool hasVertexColor) { if (init.fColorIgnored) { *color = GrColor_ILLEGAL; @@ -382,7 +378,7 @@ public: return SkNEW_ARGS(GrPathProcessor, (color, viewMatrix, localMatrix)); } - void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const SK_OVERRIDE; + void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; bool canMakeEqual(const GrBatchTracker& mine, const GrPrimitiveProcessor& that, |