Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/gpu/GrContext.cpp

Issue 128893003: Move geometry allocator for drawVertices inside autoflush scope. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698