| 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 "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff); | 557 newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff); |
| 558 | 558 |
| 559 if (!stroke->isHairlineStyle()) { | 559 if (!stroke->isHairlineStyle()) { |
| 560 stroke.writable()->setHairlineStyle(); | 560 stroke.writable()->setHairlineStyle(); |
| 561 } | 561 } |
| 562 } | 562 } |
| 563 | 563 |
| 564 const bool isHairline = stroke->isHairlineStyle(); | 564 const bool isHairline = stroke->isHairlineStyle(); |
| 565 | 565 |
| 566 // Save the current xp on the draw state so we can reset it if needed | 566 // Save the current xp on the draw state so we can reset it if needed |
| 567 SkAutoTUnref<const GrXPFactory> backupXPFactory(SkRef(pipelineBuilder->getXP
Factory())); | 567 const GrXPFactory* xpFactory = pipelineBuilder->getXPFactory(); |
| 568 SkAutoTUnref<const GrXPFactory> backupXPFactory(SkSafeRef(xpFactory)); |
| 568 // face culling doesn't make sense here | 569 // face culling doesn't make sense here |
| 569 SkASSERT(GrPipelineBuilder::kBoth_DrawFace == pipelineBuilder->getDrawFace()
); | 570 SkASSERT(GrPipelineBuilder::kBoth_DrawFace == pipelineBuilder->getDrawFace()
); |
| 570 | 571 |
| 571 int passCount = 0; | 572 int passCount = 0; |
| 572 const GrStencilSettings* passes[3]; | 573 const GrStencilSettings* passes[3]; |
| 573 GrPipelineBuilder::DrawFace drawFace[3]; | 574 GrPipelineBuilder::DrawFace drawFace[3]; |
| 574 bool reverse = false; | 575 bool reverse = false; |
| 575 bool lastPassIsBounds; | 576 bool lastPassIsBounds; |
| 576 | 577 |
| 577 if (isHairline) { | 578 if (isHairline) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 geometry.fColor = color; | 763 geometry.fColor = color; |
| 763 geometry.fPath = path; | 764 geometry.fPath = path; |
| 764 geometry.fTolerance = srcSpaceTol; | 765 geometry.fTolerance = srcSpaceTol; |
| 765 | 766 |
| 766 viewMatrix.mapRect(&bounds); | 767 viewMatrix.mapRect(&bounds); |
| 767 uint8_t coverage = GrRandomCoverage(random); | 768 uint8_t coverage = GrRandomCoverage(random); |
| 768 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 769 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
| 769 } | 770 } |
| 770 | 771 |
| 771 #endif | 772 #endif |
| OLD | NEW |