| Index: src/gpu/batches/GrAAStrokeRectBatch.h
|
| diff --git a/src/gpu/batches/GrAAStrokeRectBatch.h b/src/gpu/batches/GrAAStrokeRectBatch.h
|
| index fad5bd9d8df8293fe8465a4207a7ccb39ad787d8..23f160ec9f8d3783acc610b2f22f9d6243876062 100644
|
| --- a/src/gpu/batches/GrAAStrokeRectBatch.h
|
| +++ b/src/gpu/batches/GrAAStrokeRectBatch.h
|
| @@ -9,107 +9,21 @@
|
| #define GrAAStrokeRectBatch_DEFINED
|
|
|
| #include "GrColor.h"
|
| -#include "GrTypes.h"
|
| -#include "GrVertexBatch.h"
|
| -#include "SkMatrix.h"
|
| -#include "SkRect.h"
|
|
|
| +class GrDrawBatch;
|
| class GrResourceProvider;
|
| +class SkMatrix;
|
| +struct SkRect;
|
|
|
| -class GrAAStrokeRectBatch : public GrVertexBatch {
|
| -public:
|
| - DEFINE_BATCH_CLASS_ID
|
| +namespace GrAAStrokeRectBatch {
|
|
|
| - // TODO support AA rotated stroke rects by copying around view matrices
|
| - struct Geometry {
|
| - GrColor fColor;
|
| - SkRect fDevOutside;
|
| - SkRect fDevOutsideAssist;
|
| - SkRect fDevInside;
|
| - bool fMiterStroke;
|
| - };
|
| +GrDrawBatch* Create(GrColor color,
|
| + const SkMatrix& viewMatrix,
|
| + const SkRect& devOutside,
|
| + const SkRect& devOutsideAssist,
|
| + const SkRect& devInside,
|
| + bool miterStroke);
|
|
|
| - static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix) {
|
| - return new GrAAStrokeRectBatch(geometry, viewMatrix);
|
| - }
|
| -
|
| - const char* name() const override { return "AAStrokeRect"; }
|
| -
|
| - void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
|
| - // When this is called on a batch, there is only one geometry bundle
|
| - out->setKnownFourComponents(fGeoData[0].fColor);
|
| - }
|
| -
|
| - void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
|
| - out->setUnknownSingleComponent();
|
| - }
|
| -
|
| - SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
|
| -
|
| -private:
|
| - void onPrepareDraws(Target*) override;
|
| - void initBatchTracker(const GrPipelineOptimizations&) override;
|
| -
|
| - GrAAStrokeRectBatch(const Geometry& geometry, const SkMatrix& viewMatrix)
|
| - : INHERITED(ClassID()) {
|
| - fBatch.fViewMatrix = viewMatrix;
|
| - fGeoData.push_back(geometry);
|
| -
|
| - // If we have miterstroke then we inset devOutside and outset devOutsideAssist, so we need
|
| - // the join for proper bounds
|
| - fBounds = geometry.fDevOutside;
|
| - fBounds.join(geometry.fDevOutsideAssist);
|
| - }
|
| -
|
| -
|
| - static const int kMiterIndexCnt = 3 * 24;
|
| - static const int kMiterVertexCnt = 16;
|
| - static const int kNumMiterRectsInIndexBuffer = 256;
|
| -
|
| - static const int kBevelIndexCnt = 48 + 36 + 24;
|
| - static const int kBevelVertexCnt = 24;
|
| - static const int kNumBevelRectsInIndexBuffer = 256;
|
| -
|
| - static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* resourceProvider,
|
| - bool miterStroke);
|
| -
|
| - GrColor color() const { return fBatch.fColor; }
|
| - bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
|
| - bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCoverage; }
|
| - bool colorIgnored() const { return fBatch.fColorIgnored; }
|
| - const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
|
| - bool miterStroke() const { return fBatch.fMiterStroke; }
|
| - bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
|
| -
|
| - bool onCombineIfPossible(GrBatch* t, const GrCaps&) override;
|
| -
|
| - void generateAAStrokeRectGeometry(void* vertices,
|
| - size_t offset,
|
| - size_t vertexStride,
|
| - int outerVertexNum,
|
| - int innerVertexNum,
|
| - GrColor color,
|
| - const SkRect& devOutside,
|
| - const SkRect& devOutsideAssist,
|
| - const SkRect& devInside,
|
| - bool miterStroke,
|
| - bool tweakAlphaForCoverage) const;
|
| -
|
| - struct BatchTracker {
|
| - SkMatrix fViewMatrix;
|
| - GrColor fColor;
|
| - bool fUsesLocalCoords;
|
| - bool fColorIgnored;
|
| - bool fCoverageIgnored;
|
| - bool fMiterStroke;
|
| - bool fCanTweakAlphaForCoverage;
|
| - };
|
| -
|
| - BatchTracker fBatch;
|
| - SkSTArray<1, Geometry, true> fGeoData;
|
| -
|
| - typedef GrVertexBatch INHERITED;
|
| };
|
|
|
| -
|
| #endif
|
|
|