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 {
25 GrGLPathRange(GrGpuGL*, size_t size, const SkStrokeRec&);
26 virtual ~GrGLPathRange();
28 GrGLuint basePathID() const { return fBasePathID; }
30 virtual void initAt(size_t index, const SkPath&);
32 // TODO: Use a better approximation for the individual path sizes.
33 virtual size_t gpuMemorySize() const SK_OVERRIDE {
34 return 100 * fNumDefinedPaths;
38 virtual void onRelease() SK_OVERRIDE;
39 virtual void onAbandon() SK_OVERRIDE;
43 size_t fNumDefinedPaths;
45 typedef GrPathRange INHERITED;