aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr/GrCCPathProcessor.h
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-05-23 22:51:22 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-23 22:51:33 +0000
commit13235d8966e4242ef69264aa76ad71ac4021e506 (patch)
treec5d3530ee6e28d118d759a78d1af950600c0d261 /src/gpu/ccpr/GrCCPathProcessor.h
parentc877a404e02772ff650a09a18f64844e4df745a0 (diff)
Revert "ccpr: Handle winding and even-odd in the same shader"
This reverts commit 5dd3fccb3c7d9fce2663803a1284734237d8546d. Reason for revert: fma() not supported pre-3.1 Original change's description: > ccpr: Handle winding and even-odd in the same shader > > We are already waiting for an entire texture lookup anyway. A couple > extra flops should still complete before the texture fetch. This also > gives us better batching. > > Bug: skia: > Change-Id: I83a7a8ba6c05cd1ad6b1756a987429233e69ed6c > Reviewed-on: https://skia-review.googlesource.com/129422 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,csmartdalton@google.com Change-Id: Iaa6b72686fdf89b58a0ea8418296985c2a3dc27e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/129900 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPathProcessor.h')
-rw-r--r--src/gpu/ccpr/GrCCPathProcessor.h26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/gpu/ccpr/GrCCPathProcessor.h b/src/gpu/ccpr/GrCCPathProcessor.h
index 198bc60d20..47893266da 100644
--- a/src/gpu/ccpr/GrCCPathProcessor.h
+++ b/src/gpu/ccpr/GrCCPathProcessor.h
@@ -38,14 +38,13 @@ public:
static constexpr int kNumInstanceAttribs = 1 + (int)InstanceAttribs::kColor;
struct Instance {
- SkRect fDevBounds; // "right < left" indicates even-odd fill type.
+ SkRect fDevBounds;
SkRect fDevBounds45; // Bounding box in "| 1 -1 | * devCoords" space.
// | 1 1 |
std::array<int16_t, 2> fAtlasOffset;
uint32_t fColor;
- void set(SkPath::FillType, const SkRect& devBounds, const SkRect& devBounds45,
- int16_t atlasOffsetX, int16_t atlasOffsetY, uint32_t color);
+ GR_STATIC_ASSERT(SK_SCALAR_IS_FLOAT);
};
GR_STATIC_ASSERT(4 * 10 == sizeof(Instance));
@@ -53,13 +52,14 @@ public:
static sk_sp<const GrBuffer> FindVertexBuffer(GrOnFlushResourceProvider*);
static sk_sp<const GrBuffer> FindIndexBuffer(GrOnFlushResourceProvider*);
- GrCCPathProcessor(GrResourceProvider*, sk_sp<GrTextureProxy> atlas,
+ GrCCPathProcessor(GrResourceProvider*, sk_sp<GrTextureProxy> atlas, SkPath::FillType,
const SkMatrix& viewMatrixIfUsingLocalCoords = SkMatrix::I());
const char* name() const override { return "GrCCPathProcessor"; }
const GrSurfaceProxy* atlasProxy() const { return fAtlasAccess.proxy(); }
const GrTexture* atlas() const { return fAtlasAccess.peekTexture(); }
const SkMatrix& localMatrix() const { return fLocalMatrix; }
+ SkPath::FillType fillType() const { return fFillType; }
const Attribute& getInstanceAttrib(InstanceAttribs attribID) const {
const Attribute& attrib = this->getAttrib((int)attribID);
SkASSERT(Attribute::InputRate::kPerInstance == attrib.fInputRate);
@@ -72,7 +72,7 @@ public:
return attrib;
}
- void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
+ void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
void drawPaths(GrOpFlushState*, const GrPipeline&, const GrBuffer* indexBuffer,
@@ -80,25 +80,11 @@ public:
int endInstance, const SkRect& bounds) const;
private:
+ const SkPath::FillType fFillType;
const TextureSampler fAtlasAccess;
SkMatrix fLocalMatrix;
typedef GrGeometryProcessor INHERITED;
};
-inline void GrCCPathProcessor::Instance::set(SkPath::FillType fillType, const SkRect& devBounds,
- const SkRect& devBounds45, int16_t atlasOffsetX,
- int16_t atlasOffsetY, uint32_t color) {
- if (SkPath::kEvenOdd_FillType == fillType) {
- // "right < left" indicates even-odd fill type.
- fDevBounds.setLTRB(devBounds.fRight, devBounds.fTop, devBounds.fLeft, devBounds.fBottom);
- } else {
- SkASSERT(SkPath::kWinding_FillType == fillType);
- fDevBounds = devBounds;
- }
- fDevBounds45 = devBounds45;
- fAtlasOffset = {{atlasOffsetX, atlasOffsetY}};
- fColor = color;
-}
-
#endif