| 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 | 9 |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // matrix to normalized coords. | 179 // matrix to normalized coords. |
| 180 SkMatrix maskMatrix; | 180 SkMatrix maskMatrix; |
| 181 maskMatrix.setIDiv(texture->width(), texture->height()); | 181 maskMatrix.setIDiv(texture->width(), texture->height()); |
| 182 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); | 182 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); |
| 183 | 183 |
| 184 GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); | 184 GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint)); |
| 185 pipelineBuilder.setUserStencil(userStencilSettings); | 185 pipelineBuilder.setUserStencil(userStencilSettings); |
| 186 | 186 |
| 187 pipelineBuilder.addCoverageFragmentProcessor( | 187 pipelineBuilder.addCoverageFragmentProcessor( |
| 188 GrSimpleTextureEffect::Make(texture, | 188 GrSimpleTextureEffect::Make(texture, |
| 189 nullptr, |
| 189 maskMatrix, | 190 maskMatrix, |
| 190 GrTextureParams::kNone_Filt
erMode, | 191 GrTextureParams::kNone_Filt
erMode, |
| 191 kDevice_GrCoordSet)); | 192 kDevice_GrCoordSet)); |
| 192 | 193 |
| 193 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.ge
tColor(), | 194 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.ge
tColor(), |
| 194 SkMatrix
::I(), | 195 SkMatrix
::I(), |
| 195 dstRect,
nullptr, &invert)); | 196 dstRect,
nullptr, &invert)); |
| 196 drawContext->drawBatch(pipelineBuilder, clip, batch); | 197 drawContext->drawBatch(pipelineBuilder, clip, batch); |
| 197 } | 198 } |
| OLD | NEW |