Separate GL path rendering state from GrGpuGL to GrGLPathRendering
Separate GL path rendering state from GrGpuGL to GrGLPathRendering. This
makes GrGpuGL code simpler.
The intention is that while GrGpuGL represents the global environment for GL,
the GrGLPathRendering represents the global environment for path rendering
extension.
Add GrPathRendering, a base class for path rendering, and inherit
GrGLPathRendering from that. Move the path rendering virtual functions from
GrGpu to GrPathRendering.
R=bsalomon@google.com, cdalton@nvidia.com
Author: kkinnunen@nvidia.com
Review URL: https://codereview.chromium.org/452823002
diff --git a/src/gpu/gl/GrGLPathRange.cpp b/src/gpu/gl/GrGLPathRange.cpp
index 5e89cb5..9aaf9db 100644
--- a/src/gpu/gl/GrGLPathRange.cpp
+++ b/src/gpu/gl/GrGLPathRange.cpp
@@ -13,7 +13,7 @@
GrGLPathRange::GrGLPathRange(GrGpuGL* gpu, size_t size, const SkStrokeRec& stroke)
: INHERITED(gpu, size, stroke),
- fBasePathID(gpu->pathRendering()->genPaths(fSize)),
+ fBasePathID(gpu->glPathRendering()->genPaths(fSize)),
fNumDefinedPaths(0) {
}
@@ -28,7 +28,7 @@
}
// Make sure the path at this index hasn't been initted already.
- SkASSERT(GR_GL_FALSE == gpu->pathRendering()->isPath(fBasePathID + index));
+ SkASSERT(GR_GL_FALSE == gpu->glPathRendering()->isPath(fBasePathID + index));
GrGLPath::InitPathObject(gpu, fBasePathID + index, skPath, fStroke);
++fNumDefinedPaths;
@@ -39,7 +39,7 @@
SkASSERT(NULL != this->getGpu());
if (0 != fBasePathID && !this->isWrapped()) {
- static_cast<GrGpuGL*>(this->getGpu())->pathRendering()->deletePaths(fBasePathID, fSize);
+ static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fBasePathID, fSize);
fBasePathID = 0;
}