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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // a translation so that the top-left of the device bounds maps to 0,0, and
then a scaling | 182 // a translation so that the top-left of the device bounds maps to 0,0, and
then a scaling |
183 // matrix to normalized coords. | 183 // matrix to normalized coords. |
184 SkMatrix maskMatrix; | 184 SkMatrix maskMatrix; |
185 maskMatrix.setIDiv(texture->width(), texture->height()); | 185 maskMatrix.setIDiv(texture->width(), texture->height()); |
186 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); | 186 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); |
187 | 187 |
188 GrPipelineBuilder pipelineBuilder(*paint, drawContext->mustUseHWAA(*paint)); | 188 GrPipelineBuilder pipelineBuilder(*paint, drawContext->mustUseHWAA(*paint)); |
189 pipelineBuilder.setUserStencil(userStencilSettings); | 189 pipelineBuilder.setUserStencil(userStencilSettings); |
190 | 190 |
191 pipelineBuilder.addCoverageFragmentProcessor( | 191 pipelineBuilder.addCoverageFragmentProcessor( |
192 GrSimpleTextureEffect::Create(texture, | 192 GrSimpleTextureEffect::Make(texture, |
193 maskMatrix, | 193 maskMatrix, |
194 GrTextureParams::kNone_Fi
lterMode, | 194 GrTextureParams::kNone_Filt
erMode, |
195 kDevice_GrCoordSet))->unr
ef(); | 195 kDevice_GrCoordSet)); |
196 | 196 |
197 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), | 197 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), |
198 dstRect,
nullptr, &invert)); | 198 dstRect,
nullptr, &invert)); |
199 drawContext->drawBatch(pipelineBuilder, clip, batch); | 199 drawContext->drawBatch(pipelineBuilder, clip, batch); |
200 } | 200 } |
OLD | NEW |