| 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 "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
| 9 | 9 |
| 10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 const GrTextureAccess& textureAccess = processor.textureAccess(s); | 119 const GrTextureAccess& textureAccess = processor.textureAccess(s); |
| 120 fGpu->bindTexture(samplers[s].fTextureUnit, | 120 fGpu->bindTexture(samplers[s].fTextureUnit, |
| 121 textureAccess.getParams(), | 121 textureAccess.getParams(), |
| 122 static_cast<GrGLTexture*>(textureAccess.getTexture()))
; | 122 static_cast<GrGLTexture*>(textureAccess.getTexture()))
; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 | 126 |
| 127 /////////////////////////////////////////////////////////////////////////////// | 127 /////////////////////////////////////////////////////////////////////////////// |
| 128 | 128 |
| 129 void GrGLProgram::setData(const GrOptDrawState& optState, | 129 void GrGLProgram::setData(const GrOptDrawState& optState, GrGpu::DrawType drawTy
pe) { |
| 130 GrGpu::DrawType drawType, | |
| 131 const GrDeviceCoordTexture* dstCopy) { | |
| 132 GrColor color = optState.getColor(); | 130 GrColor color = optState.getColor(); |
| 133 uint8_t coverage = optState.getCoverage(); | 131 uint8_t coverage = optState.getCoverage(); |
| 134 | 132 |
| 135 this->setColor(optState, color); | 133 this->setColor(optState, color); |
| 136 this->setCoverage(optState, coverage); | 134 this->setCoverage(optState, coverage); |
| 137 this->setMatrixAndRenderTargetHeight(drawType, optState); | 135 this->setMatrixAndRenderTargetHeight(drawType, optState); |
| 138 | 136 |
| 137 const GrDeviceCoordTexture* dstCopy = optState.getDstCopy(); |
| 139 if (dstCopy) { | 138 if (dstCopy) { |
| 140 if (fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()) { | 139 if (fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()) { |
| 141 fProgramDataManager.set2f(fBuiltinUniformHandles.fDstCopyTopLeftUni, | 140 fProgramDataManager.set2f(fBuiltinUniformHandles.fDstCopyTopLeftUni, |
| 142 static_cast<GrGLfloat>(dstCopy->offset().
fX), | 141 static_cast<GrGLfloat>(dstCopy->offset().
fX), |
| 143 static_cast<GrGLfloat>(dstCopy->offset().
fY)); | 142 static_cast<GrGLfloat>(dstCopy->offset().
fY)); |
| 144 fProgramDataManager.set2f(fBuiltinUniformHandles.fDstCopyScaleUni, | 143 fProgramDataManager.set2f(fBuiltinUniformHandles.fDstCopyScaleUni, |
| 145 1.f / dstCopy->texture()->width(), | 144 1.f / dstCopy->texture()->width(), |
| 146 1.f / dstCopy->texture()->height()); | 145 1.f / dstCopy->texture()->height()); |
| 147 GrGLTexture* texture = static_cast<GrGLTexture*>(dstCopy->texture())
; | 146 GrGLTexture* texture = static_cast<GrGLTexture*>(dstCopy->texture())
; |
| 148 static GrTextureParams kParams; // the default is clamp, nearest fil
tering. | 147 static GrTextureParams kParams; // the default is clamp, nearest fil
tering. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 for (int t = 0; t < numTransforms; ++t) { | 378 for (int t = 0; t < numTransforms; ++t) { |
| 380 const SkMatrix& transform = get_transform_matrix(proc, false, t); | 379 const SkMatrix& transform = get_transform_matrix(proc, false, t); |
| 381 GrGLPathRendering::PathTexGenComponents components = | 380 GrGLPathRendering::PathTexGenComponents components = |
| 382 GrGLPathRendering::kST_PathTexGenComponents; | 381 GrGLPathRendering::kST_PathTexGenComponents; |
| 383 if (proc.isPerspectiveCoordTransform(t)) { | 382 if (proc.isPerspectiveCoordTransform(t)) { |
| 384 components = GrGLPathRendering::kSTR_PathTexGenComponents; | 383 components = GrGLPathRendering::kSTR_PathTexGenComponents; |
| 385 } | 384 } |
| 386 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); | 385 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); |
| 387 } | 386 } |
| 388 } | 387 } |
| OLD | NEW |