| 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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
| 9 #include "GrOvalRenderer.h" | 9 #include "GrOvalRenderer.h" |
| 10 | 10 |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 // center | 874 // center |
| 875 // we place this at the end so that we can ignore these indices when renderi
ng stroke-only | 875 // we place this at the end so that we can ignore these indices when renderi
ng stroke-only |
| 876 5, 6, 10, 5, 10, 9 | 876 5, 6, 10, 5, 10, 9 |
| 877 }; | 877 }; |
| 878 | 878 |
| 879 | 879 |
| 880 GrIndexBuffer* GrOvalRenderer::rRectIndexBuffer(GrGpu* gpu) { | 880 GrIndexBuffer* GrOvalRenderer::rRectIndexBuffer(GrGpu* gpu) { |
| 881 if (NULL == fRRectIndexBuffer) { | 881 if (NULL == fRRectIndexBuffer) { |
| 882 fRRectIndexBuffer = | 882 fRRectIndexBuffer = |
| 883 gpu->createIndexBuffer(sizeof(gRRectIndices), false); | 883 gpu->createIndexBuffer(sizeof(gRRectIndices), false); |
| 884 if (NULL != fRRectIndexBuffer) { | 884 if (fRRectIndexBuffer) { |
| 885 #ifdef SK_DEBUG | 885 #ifdef SK_DEBUG |
| 886 bool updated = | 886 bool updated = |
| 887 #endif | 887 #endif |
| 888 fRRectIndexBuffer->updateData(gRRectIndices, | 888 fRRectIndexBuffer->updateData(gRRectIndices, |
| 889 sizeof(gRRectIndices)); | 889 sizeof(gRRectIndices)); |
| 890 GR_DEBUGASSERT(updated); | 890 GR_DEBUGASSERT(updated); |
| 891 } | 891 } |
| 892 } | 892 } |
| 893 return fRRectIndexBuffer; | 893 return fRRectIndexBuffer; |
| 894 } | 894 } |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 | 1226 |
| 1227 // drop out the middle quad if we're stroked | 1227 // drop out the middle quad if we're stroked |
| 1228 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : | 1228 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : |
| 1229 SK_ARRAY_COUNT(gRRectIndices); | 1229 SK_ARRAY_COUNT(gRRectIndices); |
| 1230 target->setIndexSourceToBuffer(indexBuffer); | 1230 target->setIndexSourceToBuffer(indexBuffer); |
| 1231 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 1231 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 return true; | 1234 return true; |
| 1235 } | 1235 } |
| OLD | NEW |