Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: src/gpu/gl/GrGLPathRange.h

Issue 563283004: Use per-typeface sets of glyphs for nvpr text (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glyphmemorypath
Patch Set: Fix builds Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLPath.cpp ('k') | src/gpu/gl/GrGLPathRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « src/gpu/gl/GrGLPath.cpp ('k') | src/gpu/gl/GrGLPathRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698