aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgram.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-28 11:56:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-31 16:02:42 +0000
commitdf0e09feacb29290fe94d37f921731b18f2edae0 (patch)
tree8059c31deb493e101b616578f6db0d4bc4d05438 /src/gpu/gl/GrGLProgram.cpp
parentf57c0d67611186ba74179b53b421e64b63a579c7 (diff)
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 <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLProgram.cpp')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp20
1 files changed, 12 insertions, 8 deletions
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<GrGLTexture*>(dstTexture));
+ static_cast<GrGLTexture*>(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<GrPathProcessor>();
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<GrGLTexture*>(sampler.peekTexture()));
+ allowSRGBInputs, static_cast<GrGLTexture*>(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<GrGLTexture*>(sampler.peekTexture()));
+ static_cast<GrGLTexture*>(sampler.peekTexture()),
+ sampler.proxy()->origin());
}
}