Revert of move program descriptor generation to flush (patchset #7 id:120001 of https://codereview.chromium.org/777673003/)
Reason for revert:
breaking linux build
Original issue's description:
> move program descriptor generation to flush
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/829e1b80b1020b17f2078020c990e079b70c077c
TBR=egdaniel@google.com,bsalomon@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/776243005
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 3b04edb..63cb9da 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -123,13 +123,13 @@
///////////////////////////////////////////////////////////////////////////////
-void GrGLProgram::setData(const GrOptDrawState& optState) {
+void GrGLProgram::setData(const GrOptDrawState& optState, GrGpu::DrawType drawType) {
GrColor color = optState.getColor();
uint8_t coverage = optState.getCoverage();
this->setColor(optState, color);
this->setCoverage(optState, coverage);
- this->setMatrixAndRenderTargetHeight(optState);
+ this->setMatrixAndRenderTargetHeight(drawType, optState);
const GrDeviceCoordTexture* dstCopy = optState.getDstCopy();
if (dstCopy) {
@@ -164,7 +164,7 @@
this->setFragmentData(optState);
// Some of GrGLProgram subclasses need to update state here
- this->didSetData(optState.drawType());
+ this->didSetData(drawType);
}
void GrGLProgram::setFragmentData(const GrOptDrawState& optState) {
@@ -241,7 +241,8 @@
}
}
-void GrGLProgram::setMatrixAndRenderTargetHeight(const GrOptDrawState& optState) {
+void GrGLProgram::setMatrixAndRenderTargetHeight(GrGpu::DrawType drawType,
+ const GrOptDrawState& optState) {
// Load the RT height uniform if it is needed to y-flip gl_FragCoord.
if (fBuiltinUniformHandles.fRTHeightUni.isValid() &&
fMatrixState.fRenderTargetSize.fHeight != optState.getRenderTarget()->height()) {
@@ -250,10 +251,11 @@
}
// call subclasses to set the actual view matrix
- this->onSetMatrixAndRenderTargetHeight(optState);
+ this->onSetMatrixAndRenderTargetHeight(drawType, optState);
}
-void GrGLProgram::onSetMatrixAndRenderTargetHeight(const GrOptDrawState& optState) {
+void GrGLProgram::onSetMatrixAndRenderTargetHeight(GrGpu::DrawType drawType,
+ const GrOptDrawState& optState) {
const GrRenderTarget* rt = optState.getRenderTarget();
SkISize size;
size.set(rt->width(), rt->height());
@@ -287,8 +289,9 @@
: INHERITED(gpu, desc, builtinUniforms, programID, uniforms, NULL, fragmentProcessors) {
}
-void GrGLNvprProgramBase::onSetMatrixAndRenderTargetHeight(const GrOptDrawState& optState) {
- SkASSERT(GrGpu::IsPathRenderingDrawType(optState.drawType()));
+void GrGLNvprProgramBase::onSetMatrixAndRenderTargetHeight(GrGpu::DrawType drawType,
+ const GrOptDrawState& optState) {
+ SkASSERT(GrGpu::IsPathRenderingDrawType(drawType));
const GrRenderTarget* rt = optState.getRenderTarget();
SkISize size;
size.set(rt->width(), rt->height());