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

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

Issue 14081016: Remove static effects from the effect memory pool. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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 "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 * window space (y-down). If either the third or fourth component of the interpo lated 443 * window space (y-down). If either the third or fourth component of the interpo lated
444 * vertex coord is > 0 then the pixel is considered outside the edge. This is us ed to 444 * vertex coord is > 0 then the pixel is considered outside the edge. This is us ed to
445 * attempt to trim to a portion of the infinite quad. 445 * attempt to trim to a portion of the infinite quad.
446 * Requires shader derivative instruction support. 446 * Requires shader derivative instruction support.
447 */ 447 */
448 448
449 class QuadEdgeEffect : public GrEffect { 449 class QuadEdgeEffect : public GrEffect {
450 public: 450 public:
451 451
452 static GrEffectRef* Create() { 452 static GrEffectRef* Create() {
453 // we go through this so we only have one copy of each effect 453 GR_CREATE_STATIC_EFFECT(gQuadEdgeEffect, QuadEdgeEffect, ());
454 static SkAutoTUnref<GrEffectRef> gQuadEdgeEffectRef( 454 gQuadEdgeEffect->ref();
455 CreateEffectRef(AutoEffectUnref(SkNEW(QuadEdgeEffect)))); 455 return gQuadEdgeEffect;
456
457 gQuadEdgeEffectRef.get()->ref();
458 return gQuadEdgeEffectRef;
459 } 456 }
460 457
461 virtual ~QuadEdgeEffect() {} 458 virtual ~QuadEdgeEffect() {}
462 459
463 static const char* Name() { return "QuadEdge"; } 460 static const char* Name() { return "QuadEdge"; }
464 461
465 virtual void getConstantColorComponents(GrColor* color, 462 virtual void getConstantColorComponents(GrColor* color,
466 uint32_t* validFlags) const SK_OVERR IDE { 463 uint32_t* validFlags) const SK_OVERR IDE {
467 *validFlags = 0; 464 *validFlags = 0;
468 } 465 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 create_vertices(segments, fanPt, verts, idxs); 632 create_vertices(segments, fanPt, verts, idxs);
636 633
637 target->drawIndexed(kTriangles_GrPrimitiveType, 634 target->drawIndexed(kTriangles_GrPrimitiveType,
638 0, // start vertex 635 0, // start vertex
639 0, // start index 636 0, // start index
640 vCount, 637 vCount,
641 iCount); 638 iCount);
642 639
643 return true; 640 return true;
644 } 641 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698