diff options
author | 2015-05-18 23:02:07 -0700 | |
---|---|---|
committer | 2015-05-18 23:02:07 -0700 | |
commit | 50b58e6fbcc50785ceffacb2c51b22c6e67a7ab7 (patch) | |
tree | 90e4c1dbf12534523f1f7e8a1cece158bd58cb45 /src/gpu/gl/GrGLPathRange.h | |
parent | 54b8511189bb5da6bfd248fa63f5c4156e9e2bd6 (diff) |
Improve caching of dashed paths in GrStencilAndCoverPathRenderer
Improve caching of dashed paths in GrStencilAndCoverPathRenderer.
Look up the (NVPR specific) GrGLPath based on GrStrokeInfo and
the original path.
Use unique keys for all GrPaths.
Dash the path with Skia dash stroker and use that path geometry for
NVPR path.
NVPR internal dashing stroke is not used, because the dashing
implementation of NVPR does not match Skia implementation.
Review URL: https://codereview.chromium.org/1116123003
Diffstat (limited to 'src/gpu/gl/GrGLPathRange.h')
-rw-r--r-- | src/gpu/gl/GrGLPathRange.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLPathRange.h b/src/gpu/gl/GrGLPathRange.h index 5cba9c79d7..22dd1c0572 100644 --- a/src/gpu/gl/GrGLPathRange.h +++ b/src/gpu/gl/GrGLPathRange.h @@ -10,6 +10,7 @@ #define GrGLPathRange_DEFINED #include "../GrPathRange.h" +#include "GrStrokeInfo.h" #include "gl/GrGLFunctions.h" class GrGLGpu; @@ -26,7 +27,7 @@ public: * Initialize a GL path range from a PathGenerator. This class will allocate * the GPU path objects and initialize them lazily. */ - GrGLPathRange(GrGLGpu*, PathGenerator*, const SkStrokeRec&); + GrGLPathRange(GrGLGpu*, PathGenerator*, const GrStrokeInfo&); /** * Initialize a GL path range from an existing range of pre-initialized GPU @@ -37,10 +38,13 @@ public: GrGLuint basePathID, int numPaths, size_t gpuMemorySize, - const SkStrokeRec&); + const GrStrokeInfo&); GrGLuint basePathID() const { return fBasePathID; } + bool shouldStroke() const { return fShouldStroke; } + bool shouldFill() const { return fShouldFill; } + protected: void onInitPath(int index, const SkPath&) const override; @@ -48,10 +52,14 @@ protected: void onAbandon() override; private: + void init(); size_t onGpuMemorySize() const override { return fGpuMemorySize; } + const GrStrokeInfo fStroke; GrGLuint fBasePathID; mutable size_t fGpuMemorySize; + bool fShouldStroke; + bool fShouldFill; typedef GrPathRange INHERITED; }; |