aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-28 17:11:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-29 12:48:18 +0000
commit02bb6df0819d932a7a7ef8c6fb6914e3c5a0f4a2 (patch)
treef4e17dececaaa753ccc3b295ee6fcb1cfbc51006 /src/gpu/gl
parent1ec1faaff415a95022edfd504f552853a9af5d0a (diff)
Retract GrPipeline from setRenderTargetState calls
Split out of: https://skia-review.googlesource.com/c/10284/ (Remove GrSurface-derived classes from ops) Change-Id: Ib3dda649875b8da31def20476e4b5a87a4aa7cac Reviewed-on: https://skia-review.googlesource.com/10320 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp10
-rw-r--r--src/gpu/gl/GrGLProgram.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index d9e73f04e4..2aa572dfcb 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -66,7 +66,7 @@ void GrGLProgram::abandon() {
///////////////////////////////////////////////////////////////////////////////
void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline& pipeline) {
- this->setRenderTargetState(primProc, pipeline);
+ this->setRenderTargetState(primProc, pipeline.getRenderTarget());
// we set the textures, and uniforms for installed processors in a generic way, but subclasses
// of GLProgram determine how to set coord transforms
@@ -111,16 +111,14 @@ void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc,
void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc,
- const GrPipeline& pipeline) {
+ const GrRenderTarget* rt) {
// Load the RT height uniform if it is needed to y-flip gl_FragCoord.
if (fBuiltinUniformHandles.fRTHeightUni.isValid() &&
- fRenderTargetState.fRenderTargetSize.fHeight != pipeline.getRenderTarget()->height()) {
- fProgramDataManager.set1f(fBuiltinUniformHandles.fRTHeightUni,
- SkIntToScalar(pipeline.getRenderTarget()->height()));
+ fRenderTargetState.fRenderTargetSize.fHeight != rt->height()) {
+ fProgramDataManager.set1f(fBuiltinUniformHandles.fRTHeightUni, SkIntToScalar(rt->height()));
}
// set RT adjustment
- const GrRenderTarget* rt = pipeline.getRenderTarget();
SkISize size;
size.set(rt->width(), rt->height());
if (!primProc.isPathRendering()) {
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 9c429782c5..cd547b0b74 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -122,7 +122,7 @@ protected:
void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, int* nextSamplerIdx);
// Helper for setData() that sets the view matrix and loads the render target height uniform
- void setRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&);
+ void setRenderTargetState(const GrPrimitiveProcessor&, const GrRenderTarget*);
// Helper for setData() that binds textures and texel buffers to the appropriate texture units
void bindTextures(const GrProcessor&, bool allowSRGBInputs, int* nextSamplerIdx);