Calculate rough approximations for nvpr path sizes
Calculates a rough approximation of the actual value for gpuMemorySize
in GrGLPath and GrGLPathRange, instead of assuming every path is the
same fixed size.
BUG=skia:
R=bsalomon@google.com, markkilgard@gmail.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/442603002
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 5e89cb5..9e2b2e7 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -14,7 +14,7 @@
GrGLPathRange::GrGLPathRange(GrGpuGL* gpu, size_t size, const SkStrokeRec& stroke)
: INHERITED(gpu, size, stroke),
fBasePathID(gpu->pathRendering()->genPaths(fSize)),
- fNumDefinedPaths(0) {
+ fGpuMemorySize(0) {
}
GrGLPathRange::~GrGLPathRange() {
@@ -30,8 +30,7 @@
// Make sure the path at this index hasn't been initted already.
SkASSERT(GR_GL_FALSE == gpu->pathRendering()->isPath(fBasePathID + index));
- GrGLPath::InitPathObject(gpu, fBasePathID + index, skPath, fStroke);
- ++fNumDefinedPaths;
+ fGpuMemorySize += GrGLPath::InitPathObject(gpu, fBasePathID + index, skPath, fStroke);
this->didChangeGpuMemorySize();
}