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 "GrPipelineBuilder.h" | |
11 #include "GrCaps.h" | 10 #include "GrCaps.h" |
12 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
13 #include "GrGpu.h" | 12 #include "GrGpu.h" |
| 13 #include "GrPipelineBuilder.h" |
14 | 14 |
15 #include "SkData.h" | 15 #include "SkData.h" |
16 #include "SkDistanceFieldGen.h" | 16 #include "SkDistanceFieldGen.h" |
17 #include "SkStrokeRec.h" | 17 #include "SkStrokeRec.h" |
18 | 18 |
19 // TODO: try to remove this #include | 19 #include "batches/GrRectBatchFactory.h" |
20 #include "GrContext.h" | |
21 | 20 |
22 namespace { | 21 namespace { |
23 | 22 |
24 /* | 23 /* |
25 * Convert a boolean operation into a transfer mode code | 24 * Convert a boolean operation into a transfer mode code |
26 */ | 25 */ |
27 SkXfermode::Mode op_to_mode(SkRegion::Op op) { | 26 SkXfermode::Mode op_to_mode(SkRegion::Op op) { |
28 | 27 |
29 static const SkXfermode::Mode modeMap[] = { | 28 static const SkXfermode::Mode modeMap[] = { |
30 SkXfermode::kDstOut_Mode, // kDifference_Op | 29 SkXfermode::kDstOut_Mode, // kDifference_Op |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 SkMatrix maskMatrix; | 364 SkMatrix maskMatrix; |
366 maskMatrix.setIDiv(texture->width(), texture->height()); | 365 maskMatrix.setIDiv(texture->width(), texture->height()); |
367 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); | 366 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop
)); |
368 | 367 |
369 pipelineBuilder->addCoverageFragmentProcessor( | 368 pipelineBuilder->addCoverageFragmentProcessor( |
370 GrSimpleTextureEffect::Create(texture, | 369 GrSimpleTextureEffect::Create(texture, |
371 maskMatrix, | 370 maskMatrix, |
372 GrTextureParams::kNone_Fi
lterMode, | 371 GrTextureParams::kNone_Fi
lterMode, |
373 kDevice_GrCoordSet))->unr
ef(); | 372 kDevice_GrCoordSet))->unr
ef(); |
374 | 373 |
375 target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), dstRect, inver
t); | 374 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), |
| 375 dstRect,
nullptr, &invert)); |
| 376 target->drawBatch(*pipelineBuilder, batch); |
376 } | 377 } |
OLD | NEW |