OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
10 #include "GrBatchTest.h" | 10 #include "GrBatchTest.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 // TODO clients should give us bounds | 402 // TODO clients should give us bounds |
403 SkRect bounds; | 403 SkRect bounds; |
404 if (!bounds.setBoundsCheck(positions, vertexCount)) { | 404 if (!bounds.setBoundsCheck(positions, vertexCount)) { |
405 SkDebugf("drawVertices call empty bounds\n"); | 405 SkDebugf("drawVertices call empty bounds\n"); |
406 return; | 406 return; |
407 } | 407 } |
408 | 408 |
409 viewMatrix.mapRect(&bounds); | 409 viewMatrix.mapRect(&bounds); |
410 | 410 |
411 // If we don't have AA then we outset for a half pixel in each direction to account for | 411 // If we don't have AA then we outset for a half pixel in each direction to account for |
412 // snapping | 412 // snapping. We also do this for the "hair" primitive types: lines and point s since they have |
413 if (!paint.isAntiAlias()) { | 413 // a 1 pixel thickness in device space. |
414 if (!paint.isAntiAlias() || GrIsPrimTypeLines(primitiveType) || | |
robertphillips
2015/11/23 18:58:45
yodafy ?
bsalomon
2015/11/23 19:01:19
Done.
| |
415 primitiveType == kPoints_GrPrimitiveType) { | |
414 bounds.outset(0.5f, 0.5f); | 416 bounds.outset(0.5f, 0.5f); |
415 } | 417 } |
416 | 418 |
417 GrDrawVerticesBatch::Geometry geometry; | 419 GrDrawVerticesBatch::Geometry geometry; |
418 geometry.fColor = paint.getColor(); | 420 geometry.fColor = paint.getColor(); |
419 SkAutoTUnref<GrDrawBatch> batch(GrDrawVerticesBatch::Create(geometry, primit iveType, viewMatrix, | 421 SkAutoTUnref<GrDrawBatch> batch(GrDrawVerticesBatch::Create(geometry, primit iveType, viewMatrix, |
420 positions, verte xCount, indices, | 422 positions, verte xCount, indices, |
421 indexCount, colo rs, texCoords, | 423 indexCount, colo rs, texCoords, |
422 bounds)); | 424 bounds)); |
423 | 425 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
809 args.fAntiAlias = useCoverageAA; | 811 args.fAntiAlias = useCoverageAA; |
810 pr->drawPath(args); | 812 pr->drawPath(args); |
811 } | 813 } |
812 | 814 |
813 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { | 815 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { |
814 RETURN_IF_ABANDONED | 816 RETURN_IF_ABANDONED |
815 SkDEBUGCODE(this->validate();) | 817 SkDEBUGCODE(this->validate();) |
816 | 818 |
817 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 819 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
818 } | 820 } |
OLD | NEW |