Chromium Code Reviews| Index: src/gpu/GrPathRange.h |
| diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2805bf78b51f394cb8655a39b0f86165c16be39c |
| --- /dev/null |
| +++ b/src/gpu/GrPathRange.h |
| @@ -0,0 +1,49 @@ |
| +/* |
| + * Copyright 2014 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef GrPathRange_DEFINED |
| +#define GrPathRange_DEFINED |
| + |
| +#include "GrGpuObject.h" |
| +#include "SkStrokeRec.h" |
| + |
| +class SkPath; |
| + |
| +/** |
| + * Represents a contiguous range of GPU path objects with a common stroke. The |
| + * path range is immutable with the exception that individual paths can be |
| + * initialized lazily. Unititialized paths are silently ignored by drawing |
| + * functions. |
| + */ |
| +class GrPathRange : public GrGpuObject { |
| +public: |
| + SK_DECLARE_INST_COUNT(GrPathRange); |
| + |
| + GrPathRange(GrGpu* gpu, bool isWrapped, size_t size, const SkStrokeRec& stroke) |
|
bsalomon
2014/07/17 17:27:28
given that we don't have a GrContext::wrapPathRang
Chris Dalton
2014/07/17 18:15:19
Yeah that seems fine. I'm not too familiar with th
|
| + : INHERITED(gpu, isWrapped), |
| + fSize(size), |
| + fStroke(stroke) { |
| + } |
| + |
| + size_t getSize() const { return fSize; } |
| + const SkStrokeRec& getStroke() const { return fStroke; } |
| + |
| + /** |
| + * Initialize a path in the range. It is invalid to call this method for a |
| + * path that has already been initialized. |
| + */ |
| + virtual void initAt(size_t index, const SkPath&) = 0; |
| + |
| +protected: |
| + size_t fSize; |
| + SkStrokeRec fStroke; |
| + |
| +private: |
| + typedef GrGpuObject INHERITED; |
| +}; |
| + |
| +#endif |