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/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 0ad7a18..d8c751d 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -154,7 +154,7 @@
// custom shaders, it's ignored, so we don't need to change the texgen
// settings in that case.
if (!fHasVertexShader) {
- fGpu->flushPathTexGenSettings(fTexCoordSetCnt);
+ fGpu->glPathRendering()->flushPathTexGenSettings(fTexCoordSetCnt);
}
}
@@ -247,7 +247,7 @@
if (!fHasVertexShader) {
SkASSERT(!fBuiltinUniformHandles.fViewMatrixUni.isValid());
SkASSERT(!fBuiltinUniformHandles.fRTAdjustmentUni.isValid());
- fGpu->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin());
+ fGpu->glPathRendering()->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin());
} else if (fMatrixState.fRenderTargetOrigin != rt->origin() ||
fMatrixState.fRenderTargetSize != size ||
!fMatrixState.fViewMatrix.cheapEqualTo(drawState.getViewMatrix())) {