aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrDistanceFieldGeoProc.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-10-12 10:18:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-12 14:41:12 +0000
commit5698c8a8a0dcce3bdabab3551f068bda61d741a3 (patch)
treee59206036f7352843b0e33976a19808348b2e127 /src/gpu/effects/GrDistanceFieldGeoProc.h
parent7f9b215695aae262797758b2e2a7b1d35fbe584f (diff)
Batch better in GrSmallPathRenderer and add perspective support.
Minor optimization to text regen also snuck in. Bug: skia: Change-Id: I0c5d97defdcf60b9ce663548c056db0e8bf7149b Reviewed-on: https://skia-review.googlesource.com/57942 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrDistanceFieldGeoProc.h')
-rw-r--r--src/gpu/effects/GrDistanceFieldGeoProc.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h
index 1d6d2b4a41..a09938242f 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.h
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.h
@@ -129,13 +129,11 @@ class GrDistanceFieldPathGeoProc : public GrGeometryProcessor {
public:
static constexpr int kMaxTextures = 4;
- static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
+ static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& matrix,
const sk_sp<GrTextureProxy> proxies[kMaxTextures],
- const GrSamplerState& params, uint32_t flags,
- bool usesLocalCoords) {
+ const GrSamplerState& params, uint32_t flags) {
return sk_sp<GrGeometryProcessor>(
- new GrDistanceFieldPathGeoProc(color, viewMatrix, proxies,
- params, flags, usesLocalCoords));
+ new GrDistanceFieldPathGeoProc(color, matrix, proxies, params, flags));
}
~GrDistanceFieldPathGeoProc() override {}
@@ -146,9 +144,8 @@ public:
const Attribute* inColor() const { return fInColor; }
const Attribute* inTextureCoords() const { return fInTextureCoords; }
GrColor color() const { return fColor; }
- const SkMatrix& viewMatrix() const { return fViewMatrix; }
+ const SkMatrix& matrix() const { return fMatrix; }
uint32_t getFlags() const { return fFlags; }
- bool usesLocalCoords() const { return fUsesLocalCoords; }
void addNewProxies(const sk_sp<GrTextureProxy> proxies[kMaxTextures], const GrSamplerState& p);
@@ -157,18 +154,17 @@ public:
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
private:
- GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& viewMatrix,
+ GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& matrix,
const sk_sp<GrTextureProxy> proxies[kMaxTextures],
- const GrSamplerState&, uint32_t flags, bool usesLocalCoords);
+ const GrSamplerState&, uint32_t flags);
GrColor fColor;
- SkMatrix fViewMatrix;
+ SkMatrix fMatrix; // view matrix if perspective, local matrix otherwise
TextureSampler fTextureSamplers[kMaxTextures];
uint32_t fFlags;
const Attribute* fInPosition;
const Attribute* fInColor;
const Attribute* fInTextureCoords;
- bool fUsesLocalCoords;
GR_DECLARE_GEOMETRY_PROCESSOR_TEST