3 * Copyright 2014 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
9 #ifndef GrGLPathRange_DEFINED
10 #define GrGLPathRange_DEFINED
12 #include "../GrPathRange.h"
13 #include "gl/GrGLFunctions.h"
18 * Currently this represents a range of GL_NV_path_rendering Path IDs. If we
19 * support other GL path extensions then this would have to have a type enum
20 * and/or be subclassed.
23 class GrGLPathRange : public GrPathRange {
26 * Initialize a GL path range from a PathGenerator. This class will allocate
27 * the GPU path objects and initialize them lazily.
29 GrGLPathRange(GrGLGpu*, PathGenerator*, const SkStrokeRec&);
32 * Initialize a GL path range from an existing range of pre-initialized GPU
33 * path objects. This class assumes ownership of the GPU path objects and
34 * will delete them when done.
36 GrGLPathRange(GrGLGpu*,
42 GrGLuint basePathID() const { return fBasePathID; }
45 void onInitPath(int index, const SkPath&) const SK_OVERRIDE;
47 void onRelease() SK_OVERRIDE;
48 void onAbandon() SK_OVERRIDE;
51 size_t onGpuMemorySize() const SK_OVERRIDE { return fGpuMemorySize; }
54 mutable size_t fGpuMemorySize;
56 typedef GrPathRange INHERITED;