OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 // we place this at the end so that we can ignore these indices when renderi
ng stroke-only | 581 // we place this at the end so that we can ignore these indices when renderi
ng stroke-only |
582 5, 6, 10, 5, 10, 9 | 582 5, 6, 10, 5, 10, 9 |
583 }; | 583 }; |
584 | 584 |
585 | 585 |
586 GrIndexBuffer* GrOvalRenderer::rRectIndexBuffer(GrGpu* gpu) { | 586 GrIndexBuffer* GrOvalRenderer::rRectIndexBuffer(GrGpu* gpu) { |
587 if (NULL == fRRectIndexBuffer) { | 587 if (NULL == fRRectIndexBuffer) { |
588 fRRectIndexBuffer = | 588 fRRectIndexBuffer = |
589 gpu->createIndexBuffer(sizeof(gRRectIndices), false); | 589 gpu->createIndexBuffer(sizeof(gRRectIndices), false); |
590 if (NULL != fRRectIndexBuffer) { | 590 if (NULL != fRRectIndexBuffer) { |
591 #if GR_DEBUG | 591 #if SK_DEBUG |
592 bool updated = | 592 bool updated = |
593 #endif | 593 #endif |
594 fRRectIndexBuffer->updateData(gRRectIndices, | 594 fRRectIndexBuffer->updateData(gRRectIndices, |
595 sizeof(gRRectIndices)); | 595 sizeof(gRRectIndices)); |
596 GR_DEBUGASSERT(updated); | 596 GR_DEBUGASSERT(updated); |
597 } | 597 } |
598 } | 598 } |
599 return fRRectIndexBuffer; | 599 return fRRectIndexBuffer; |
600 } | 600 } |
601 | 601 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 } | 850 } |
851 | 851 |
852 // drop out the middle quad if we're stroked | 852 // drop out the middle quad if we're stroked |
853 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); | 853 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); |
854 target->setIndexSourceToBuffer(indexBuffer); | 854 target->setIndexSourceToBuffer(indexBuffer); |
855 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 855 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
856 } | 856 } |
857 | 857 |
858 return true; | 858 return true; |
859 } | 859 } |
OLD | NEW |