| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 9 |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 void GrContext::drawVertices(const GrPaint& paint, | 935 void GrContext::drawVertices(const GrPaint& paint, |
| 936 GrPrimitiveType primitiveType, | 936 GrPrimitiveType primitiveType, |
| 937 int vertexCount, | 937 int vertexCount, |
| 938 const GrPoint positions[], | 938 const GrPoint positions[], |
| 939 const GrPoint texCoords[], | 939 const GrPoint texCoords[], |
| 940 const GrColor colors[], | 940 const GrColor colors[], |
| 941 const uint16_t indices[], | 941 const uint16_t indices[], |
| 942 int indexCount) { | 942 int indexCount) { |
| 943 SK_TRACE_EVENT0("GrContext::drawVertices"); | 943 SK_TRACE_EVENT0("GrContext::drawVertices"); |
| 944 | 944 |
| 945 GrDrawTarget::AutoReleaseGeometry geo; | |
| 946 | |
| 947 AutoRestoreEffects are; | 945 AutoRestoreEffects are; |
| 948 AutoCheckFlush acf(this); | 946 AutoCheckFlush acf(this); |
| 947 GrDrawTarget::AutoReleaseGeometry geo; // must be inside AutoCheckFlush scop
e |
| 948 |
| 949 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf
); | 949 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf
); |
| 950 | 950 |
| 951 GrDrawState* drawState = target->drawState(); | 951 GrDrawState* drawState = target->drawState(); |
| 952 | 952 |
| 953 int colorOffset = -1, texOffset = -1; | 953 int colorOffset = -1, texOffset = -1; |
| 954 set_vertex_attributes(drawState, texCoords, colors, &colorOffset, &texOffset
); | 954 set_vertex_attributes(drawState, texCoords, colors, &colorOffset, &texOffset
); |
| 955 | 955 |
| 956 size_t vertexSize = drawState->getVertexSize(); | 956 size_t vertexSize = drawState->getVertexSize(); |
| 957 if (sizeof(GrPoint) != vertexSize) { | 957 if (sizeof(GrPoint) != vertexSize) { |
| 958 if (!geo.set(target, vertexCount, 0)) { | 958 if (!geo.set(target, vertexCount, 0)) { |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 } | 1789 } |
| 1790 return path; | 1790 return path; |
| 1791 } | 1791 } |
| 1792 | 1792 |
| 1793 /////////////////////////////////////////////////////////////////////////////// | 1793 /////////////////////////////////////////////////////////////////////////////// |
| 1794 #if GR_CACHE_STATS | 1794 #if GR_CACHE_STATS |
| 1795 void GrContext::printCacheStats() const { | 1795 void GrContext::printCacheStats() const { |
| 1796 fTextureCache->printStats(); | 1796 fTextureCache->printStats(); |
| 1797 } | 1797 } |
| 1798 #endif | 1798 #endif |
| OLD | NEW |