From df0e09feacb29290fe94d37f921731b18f2edae0 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Fri, 28 Jul 2017 11:56:47 -0400 Subject: Remove origin field from GrSurface This mainly consists of rm origin from GrSurface and the wrapBackEnd* methods and then re-adding an explicit origin parameter to all the GrGpu methods that need it. Change-Id: Iabd79ae98b227b5b9409f3ab5bbcc48af9613c18 Reviewed-on: https://skia-review.googlesource.com/26363 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/gl/GrGLProgram.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/gpu/gl/GrGLProgram.cpp') diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index aa67bed65c..aa692c37db 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -70,7 +70,7 @@ void GrGLProgram::abandon() { /////////////////////////////////////////////////////////////////////////////// void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline& pipeline) { - this->setRenderTargetState(primProc, pipeline.renderTarget()); + this->setRenderTargetState(primProc, pipeline.proxy()); // we set the textures, and uniforms for installed processors in a generic way, but subclasses // of GLProgram determine how to set coord transforms @@ -97,7 +97,8 @@ void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, const GrPipeline fXferProcessor->setData(fProgramDataManager, xp, dstTexture, offset); if (dstTexture) { fGpu->bindTexture(nextTexSamplerIdx++, GrSamplerParams::ClampNoFilter(), true, - static_cast(dstTexture)); + static_cast(dstTexture), + pipeline.dstTextureProxy()->origin()); } SkASSERT(nextTexSamplerIdx == fNumTextureSamplers); SkASSERT(nextTexelBufferIdx == fNumTextureSamplers + fNumTexelBuffers); @@ -135,7 +136,8 @@ void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc, - const GrRenderTarget* rt) { + const GrRenderTargetProxy* proxy) { + GrRenderTarget* rt = proxy->priv().peekRenderTarget(); // Load the RT height uniform if it is needed to y-flip gl_FragCoord. if (fBuiltinUniformHandles.fRTHeightUni.isValid() && fRenderTargetState.fRenderTargetSize.fHeight != rt->height()) { @@ -146,10 +148,10 @@ void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc, SkISize size; size.set(rt->width(), rt->height()); if (!primProc.isPathRendering()) { - if (fRenderTargetState.fRenderTargetOrigin != rt->origin() || + if (fRenderTargetState.fRenderTargetOrigin != proxy->origin() || fRenderTargetState.fRenderTargetSize != size) { fRenderTargetState.fRenderTargetSize = size; - fRenderTargetState.fRenderTargetOrigin = rt->origin(); + fRenderTargetState.fRenderTargetOrigin = proxy->origin(); float rtAdjustmentVec[4]; fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); @@ -159,7 +161,7 @@ void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc, SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); const GrPathProcessor& pathProc = primProc.cast(); fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), - size, rt->origin()); + size, proxy->origin()); } } @@ -171,7 +173,8 @@ void GrGLProgram::bindTextures(const GrResourceIOProcessor& processor, for (int i = 0; i < processor.numTextureSamplers(); ++i) { const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(i); fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.params(), - allowSRGBInputs, static_cast(sampler.peekTexture())); + allowSRGBInputs, static_cast(sampler.peekTexture()), + sampler.proxy()->origin()); } for (int i = 0; i < processor.numBuffers(); ++i) { const GrResourceIOProcessor::BufferAccess& access = processor.bufferAccess(i); @@ -189,6 +192,7 @@ void GrGLProgram::generateMipmaps(const GrResourceIOProcessor& processor, bool a for (int i = 0; i < processor.numTextureSamplers(); ++i) { const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(i); fGpu->generateMipmaps(sampler.params(), allowSRGBInputs, - static_cast(sampler.peekTexture())); + static_cast(sampler.peekTexture()), + sampler.proxy()->origin()); } } -- cgit v1.2.3