| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrSWMaskHelper.h" | 8 #include "GrSWMaskHelper.h" |
| 9 #include "GrDrawState.h" | 9 #include "GrDrawState.h" |
| 10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // maps to 0,0, and then a scaling matrix to normalized coords. We apply thi
s matrix to the | 190 // maps to 0,0, and then a scaling matrix to normalized coords. We apply thi
s matrix to the |
| 191 // vertex positions rather than local coords. | 191 // vertex positions rather than local coords. |
| 192 SkMatrix maskMatrix; | 192 SkMatrix maskMatrix; |
| 193 maskMatrix.setIDiv(texture->width(), texture->height()); | 193 maskMatrix.setIDiv(texture->width(), texture->height()); |
| 194 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); | 194 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); |
| 195 maskMatrix.preConcat(drawState->getViewMatrix()); | 195 maskMatrix.preConcat(drawState->getViewMatrix()); |
| 196 | 196 |
| 197 drawState->addCoverageEffect( | 197 drawState->addCoverageEffect( |
| 198 GrSimpleTextureEffect::Create(texture, | 198 GrSimpleTextureEffect::Create(texture, |
| 199 maskMatrix, | 199 maskMatrix, |
| 200 false, | 200 GrTextureParams::kNone_Fi
lterMode, |
| 201 GrEffect::kPosition_Coord
sType))->unref(); | 201 GrEffect::kPosition_Coord
sType))->unref(); |
| 202 | 202 |
| 203 target->drawSimpleRect(dstRect); | 203 target->drawSimpleRect(dstRect); |
| 204 } | 204 } |
| OLD | NEW |