OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLGpu.h" | 8 #include "GrGLGpu.h" |
9 #include "GrGLBuffer.h" | 9 #include "GrGLBuffer.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 if (blendInfo.fWriteColor) { | 2044 if (blendInfo.fWriteColor) { |
2045 // Swizzle the blend to match what the shader will output. | 2045 // Swizzle the blend to match what the shader will output. |
2046 const GrSwizzle& swizzle = this->glCaps().glslCaps()->configOutputSwizzl
e( | 2046 const GrSwizzle& swizzle = this->glCaps().glslCaps()->configOutputSwizzl
e( |
2047 pipeline.getRenderTarget()->config()); | 2047 pipeline.getRenderTarget()->config()); |
2048 this->flushBlend(blendInfo, swizzle); | 2048 this->flushBlend(blendInfo, swizzle); |
2049 } | 2049 } |
2050 | 2050 |
2051 SkSTArray<8, const GrTextureAccess*> textureAccesses; | 2051 SkSTArray<8, const GrTextureAccess*> textureAccesses; |
2052 program->setData(primProc, pipeline, &textureAccesses); | 2052 program->setData(primProc, pipeline, &textureAccesses); |
2053 | 2053 |
2054 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa
rget()); | |
2055 bool allowSRGB = GrAllowSRGBForDestinationPixelConfig(glRT->config()); | |
2056 | |
2057 int numTextureAccesses = textureAccesses.count(); | 2054 int numTextureAccesses = textureAccesses.count(); |
2058 for (int i = 0; i < numTextureAccesses; i++) { | 2055 for (int i = 0; i < numTextureAccesses; i++) { |
2059 this->bindTexture(i, textureAccesses[i]->getParams(), allowSRGB, | 2056 this->bindTexture(i, textureAccesses[i]->getParams(), pipeline.getAllowS
RGBInputs(), |
2060 static_cast<GrGLTexture*>(textureAccesses[i]->getTextu
re())); | 2057 static_cast<GrGLTexture*>(textureAccesses[i]->getTextu
re())); |
2061 } | 2058 } |
2062 | 2059 |
| 2060 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa
rget()); |
2063 this->flushStencil(pipeline.getStencil()); | 2061 this->flushStencil(pipeline.getStencil()); |
2064 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or
igin()); | 2062 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or
igin()); |
2065 this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStenc
il().isDisabled()); | 2063 this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStenc
il().isDisabled()); |
2066 | 2064 |
2067 // This must come after textures are flushed because a texture may need | 2065 // This must come after textures are flushed because a texture may need |
2068 // to be msaa-resolved (which will modify bound FBO state). | 2066 // to be msaa-resolved (which will modify bound FBO state). |
2069 this->flushRenderTarget(glRT, nullptr, pipeline.getDisableOutputConversionTo
SRGB()); | 2067 this->flushRenderTarget(glRT, nullptr, pipeline.getDisableOutputConversionTo
SRGB()); |
2070 | 2068 |
2071 return true; | 2069 return true; |
2072 } | 2070 } |
(...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || | 4262 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || |
4265 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { | 4263 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { |
4266 copyParams->fFilter = GrTextureParams::kNone_FilterMode; | 4264 copyParams->fFilter = GrTextureParams::kNone_FilterMode; |
4267 copyParams->fWidth = texture->width(); | 4265 copyParams->fWidth = texture->width(); |
4268 copyParams->fHeight = texture->height(); | 4266 copyParams->fHeight = texture->height(); |
4269 return true; | 4267 return true; |
4270 } | 4268 } |
4271 } | 4269 } |
4272 return false; | 4270 return false; |
4273 } | 4271 } |
OLD | NEW |