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

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

Issue 668333005: fix memory leak (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 * 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 "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 GrContext* context, 453 GrContext* context,
454 const GrDrawTargetCaps&, 454 const GrDrawTargetCaps&,
455 GrTexture* textures[]) { 455 GrTexture* textures[]) {
456 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2))); 456 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2)));
457 } 457 }
458 458
459 /////////////////////////////////////////////////////////////////////////////// 459 ///////////////////////////////////////////////////////////////////////////////
460 460
461 void GrOvalRenderer::reset() { 461 void GrOvalRenderer::reset() {
462 SkSafeSetNull(fRRectIndexBuffer); 462 SkSafeSetNull(fRRectIndexBuffer);
463 SkSafeSetNull(fStrokeRRectIndexBuffer);
463 } 464 }
464 465
465 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo ol useAA, 466 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo ol useAA,
466 const SkRect& oval, const SkStrokeRec& stroke) 467 const SkRect& oval, const SkStrokeRec& stroke)
467 { 468 {
468 bool useCoverageAA = useAA && 469 bool useCoverageAA = useAA &&
469 !target->getDrawState().getRenderTarget()->isMultisampled() && 470 !target->getDrawState().getRenderTarget()->isMultisampled() &&
470 !target->shouldDisableCoverageAAForBlend(); 471 !target->shouldDisableCoverageAAForBlend();
471 472
472 if (!useCoverageAA) { 473 if (!useCoverageAA) {
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 // drop out the middle quad if we're stroked 1234 // drop out the middle quad if we're stroked
1234 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : 1235 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 :
1235 SK_ARRAY_COUNT(gRRectIndices); 1236 SK_ARRAY_COUNT(gRRectIndices);
1236 target->setIndexSourceToBuffer(indexBuffer); 1237 target->setIndexSourceToBuffer(indexBuffer);
1237 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 16, indexCnt , &bounds); 1238 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 16, indexCnt , &bounds);
1238 } 1239 }
1239 1240
1240 target->resetIndexSource(); 1241 target->resetIndexSource();
1241 return true; 1242 return true;
1242 } 1243 }
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