| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "GrAndroidPathRenderer.h" | 9 #include "GrAndroidPathRenderer.h" |
| 10 #include "AndroidPathRenderer.h" | 10 #include "AndroidPathRenderer.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 drawState->setAttribIndex(GrDrawState::kCoverage_AttribIndex, 1); | 49 drawState->setAttribIndex(GrDrawState::kCoverage_AttribIndex, 1); |
| 50 drawState->setAttribBindings(GrDrawState::kCoverage_AttribBindingsBit); | 50 drawState->setAttribBindings(GrDrawState::kCoverage_AttribBindingsBit); |
| 51 } else { | 51 } else { |
| 52 drawState->setDefaultVertexAttribs(); | 52 drawState->setDefaultVertexAttribs(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // allocate our vert buffer | 55 // allocate our vert buffer |
| 56 int vertCount = vertices.getSize(); | 56 int vertCount = vertices.getSize(); |
| 57 GrDrawTarget::AutoReleaseGeometry geo(target, vertCount, 0); | 57 GrDrawTarget::AutoReleaseGeometry geo(target, vertCount, 0); |
| 58 if (!geo.succeeded()) { | 58 if (!geo.succeeded()) { |
| 59 GrPrintf("Failed to get space for vertices!\n"); | 59 SkDebugf("Failed to get space for vertices!\n"); |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // copy android verts to our vertex buffer | 63 // copy android verts to our vertex buffer |
| 64 if (antiAlias) { | 64 if (antiAlias) { |
| 65 SkASSERT(sizeof(ColorVertex) == drawState->getVertexSize()); | 65 SkASSERT(sizeof(ColorVertex) == drawState->getVertexSize()); |
| 66 ColorVertex* outVert = reinterpret_cast<ColorVertex*>(geo.vertices()); | 66 ColorVertex* outVert = reinterpret_cast<ColorVertex*>(geo.vertices()); |
| 67 android::uirenderer::AlphaVertex* inVert = | 67 android::uirenderer::AlphaVertex* inVert = |
| 68 reinterpret_cast<android::uirenderer::AlphaVertex*>(vertices.getBuff
er()); | 68 reinterpret_cast<android::uirenderer::AlphaVertex*>(vertices.getBuff
er()); |
| 69 | 69 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 80 size_t vsize = drawState->getVertexSize(); | 80 size_t vsize = drawState->getVertexSize(); |
| 81 size_t copySize = vsize*vertCount; | 81 size_t copySize = vsize*vertCount; |
| 82 memcpy(geo.vertices(), vertices.getBuffer(), copySize); | 82 memcpy(geo.vertices(), vertices.getBuffer(), copySize); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // render it | 85 // render it |
| 86 target->drawNonIndexed(kTriangleStrip_GrPrimitiveType, 0, vertCount); | 86 target->drawNonIndexed(kTriangleStrip_GrPrimitiveType, 0, vertCount); |
| 87 | 87 |
| 88 return true; | 88 return true; |
| 89 } | 89 } |
| OLD | NEW |