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

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

Issue 1111603004: removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: tweaks Created 5 years, 7 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 | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 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 "GrAARectRenderer.h" 8 #include "GrAARectRenderer.h"
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchTarget.h" 10 #include "GrBatchTarget.h"
(...skipping 17 matching lines...) Expand all
28 const SkRect& r, SkScalar dx, SkScalar dy) { 28 const SkRect& r, SkScalar dx, SkScalar dy) {
29 pts->setRectFan(r.fLeft + dx, r.fTop + dy, 29 pts->setRectFan(r.fLeft + dx, r.fTop + dy,
30 r.fRight - dx, r.fBottom - dy, stride); 30 r.fRight - dx, r.fBottom - dy, stride);
31 } 31 }
32 32
33 static const GrGeometryProcessor* create_fill_rect_gp(bool tweakAlphaForCoverage , 33 static const GrGeometryProcessor* create_fill_rect_gp(bool tweakAlphaForCoverage ,
34 const SkMatrix& localMatri x) { 34 const SkMatrix& localMatri x) {
35 uint32_t flags = GrDefaultGeoProcFactory::kColor_GPType; 35 uint32_t flags = GrDefaultGeoProcFactory::kColor_GPType;
36 const GrGeometryProcessor* gp; 36 const GrGeometryProcessor* gp;
37 if (tweakAlphaForCoverage) { 37 if (tweakAlphaForCoverage) {
38 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I() , localMatrix, 38 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I() , localMatrix);
39 false, 0xff);
40 } else { 39 } else {
41 flags |= GrDefaultGeoProcFactory::kCoverage_GPType; 40 flags |= GrDefaultGeoProcFactory::kCoverage_GPType;
42 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I() , localMatrix, 41 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I() , localMatrix);
43 false, 0xff);
44 } 42 }
45 return gp; 43 return gp;
46 } 44 }
47 45
48 GR_DECLARE_STATIC_UNIQUE_KEY(gAAFillRectIndexBufferKey); 46 GR_DECLARE_STATIC_UNIQUE_KEY(gAAFillRectIndexBufferKey);
49 47
50 class AAFillRectBatch : public GrBatch { 48 class AAFillRectBatch : public GrBatch {
51 public: 49 public:
52 struct Geometry { 50 struct Geometry {
53 GrColor fColor; 51 GrColor fColor;
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 geo.fColor = GrRandomColor(random); 853 geo.fColor = GrRandomColor(random);
856 geo.fDevOutside = outside; 854 geo.fDevOutside = outside;
857 geo.fDevOutsideAssist = outsideAssist; 855 geo.fDevOutsideAssist = outsideAssist;
858 geo.fDevInside = inside; 856 geo.fDevInside = inside;
859 geo.fMiterStroke = miterStroke; 857 geo.fMiterStroke = miterStroke;
860 858
861 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); 859 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random));
862 } 860 }
863 861
864 #endif 862 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698