| Index: src/gpu/gl/GrGLPathRange.h
|
| diff --git a/src/gpu/gl/GrGLPathRange.h b/src/gpu/gl/GrGLPathRange.h
|
| index 927310d651e004424b0f3d23b46d0c264a152e00..f21ce3a7c97cf7cc8115fd9a5d616e766df2286f 100644
|
| --- a/src/gpu/gl/GrGLPathRange.h
|
| +++ b/src/gpu/gl/GrGLPathRange.h
|
| @@ -22,25 +22,38 @@ class GrGpuGL;
|
|
|
| class GrGLPathRange : public GrPathRange {
|
| public:
|
| - GrGLPathRange(GrGpuGL*, size_t size, const SkStrokeRec&);
|
| + /**
|
| + * Initialize a GL path range from a PathGenerator. This class will allocate
|
| + * the GPU path objects and initialize them lazily.
|
| + */
|
| + GrGLPathRange(GrGpuGL*, PathGenerator*, const SkStrokeRec&);
|
| +
|
| + /**
|
| + * Initialize a GL path range from an existing range of pre-initialized GPU
|
| + * path objects. This class assumes ownership of the GPU path objects and
|
| + * will delete them when done.
|
| + */
|
| + GrGLPathRange(GrGpuGL*,
|
| + GrGLuint basePathID,
|
| + int numPaths,
|
| + size_t gpuMemorySize,
|
| + const SkStrokeRec&);
|
| +
|
| virtual ~GrGLPathRange();
|
|
|
| GrGLuint basePathID() const { return fBasePathID; }
|
|
|
| - virtual void initAt(size_t index, const SkPath&);
|
| -
|
| - // TODO: Use a better approximation for the individual path sizes.
|
| - virtual size_t gpuMemorySize() const SK_OVERRIDE {
|
| - return 100 * fNumDefinedPaths;
|
| - }
|
| + virtual size_t gpuMemorySize() const SK_OVERRIDE { return fGpuMemorySize; }
|
|
|
| protected:
|
| + virtual void onInitPath(int index, const SkPath&) const;
|
| +
|
| virtual void onRelease() SK_OVERRIDE;
|
| virtual void onAbandon() SK_OVERRIDE;
|
|
|
| private:
|
| GrGLuint fBasePathID;
|
| - size_t fNumDefinedPaths;
|
| + mutable size_t fGpuMemorySize;
|
|
|
| typedef GrPathRange INHERITED;
|
| };
|
|
|