Remove destination GrRenderTargetProxy from GrPipeline
Change-Id: Ie2ee3d51220163fde8a959255dd5f6cce4e27ad8
Reviewed-on: https://skia-review.googlesource.com/c/188038
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 8a5308f..472be86 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -72,10 +72,12 @@
///////////////////////////////////////////////////////////////////////////////
-void GrGLProgram::updateUniformsAndTextureBindings(const GrPrimitiveProcessor& primProc,
+void GrGLProgram::updateUniformsAndTextureBindings(const GrRenderTarget* renderTarget,
+ GrSurfaceOrigin origin,
+ const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
const GrTextureProxy* const primProcTextures[]) {
- this->setRenderTargetState(primProc, pipeline.proxy());
+ this->setRenderTargetState(renderTarget, origin, primProc);
// we set the textures, and uniforms for installed processors in a generic way, but subclasses
// of GLProgram determine how to set coord transforms
@@ -130,9 +132,8 @@
SkASSERT(!fp && !glslFP);
}
-void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc,
- const GrRenderTargetProxy* proxy) {
- GrRenderTarget* rt = proxy->peekRenderTarget();
+void GrGLProgram::setRenderTargetState(const GrRenderTarget* rt, GrSurfaceOrigin origin,
+ const GrPrimitiveProcessor& primProc) {
// Load the RT size uniforms if they are needed
if (fBuiltinUniformHandles.fRTWidthUni.isValid() &&
fRenderTargetState.fRenderTargetSize.fWidth != rt->width()) {
@@ -147,10 +148,10 @@
SkISize size;
size.set(rt->width(), rt->height());
if (!primProc.isPathRendering()) {
- if (fRenderTargetState.fRenderTargetOrigin != proxy->origin() ||
+ if (fRenderTargetState.fRenderTargetOrigin != origin ||
fRenderTargetState.fRenderTargetSize != size) {
fRenderTargetState.fRenderTargetSize = size;
- fRenderTargetState.fRenderTargetOrigin = proxy->origin();
+ fRenderTargetState.fRenderTargetOrigin = origin;
float rtAdjustmentVec[4];
fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec);
@@ -160,6 +161,6 @@
SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>();
fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(),
- size, proxy->origin());
+ size, origin);
}
}