OLD | NEW |
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 26 matching lines...) Expand all Loading... |
37 static const int kIndicesPerAAFillRect = SK_ARRAY_COUNT(gFillAARectIdx); | 37 static const int kIndicesPerAAFillRect = SK_ARRAY_COUNT(gFillAARectIdx); |
38 static const int kVertsPerAAFillRect = 8; | 38 static const int kVertsPerAAFillRect = 8; |
39 static const int kNumAAFillRectsInIndexBuffer = 256; | 39 static const int kNumAAFillRectsInIndexBuffer = 256; |
40 | 40 |
41 static const GrGeometryProcessor* create_fill_rect_gp(bool tweakAlphaForCoverage
, | 41 static const GrGeometryProcessor* create_fill_rect_gp(bool tweakAlphaForCoverage
, |
42 const SkMatrix& localMatri
x) { | 42 const SkMatrix& localMatri
x) { |
43 uint32_t flags = GrDefaultGeoProcFactory::kColor_GPType; | 43 uint32_t flags = GrDefaultGeoProcFactory::kColor_GPType; |
44 const GrGeometryProcessor* gp; | 44 const GrGeometryProcessor* gp; |
45 if (tweakAlphaForCoverage) { | 45 if (tweakAlphaForCoverage) { |
46 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I()
, localMatrix, | 46 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I()
, localMatrix, |
47 0xff); | 47 false, 0xff); |
48 } else { | 48 } else { |
49 flags |= GrDefaultGeoProcFactory::kCoverage_GPType; | 49 flags |= GrDefaultGeoProcFactory::kCoverage_GPType; |
50 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I()
, localMatrix, | 50 gp = GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, SkMatrix::I()
, localMatrix, |
51 0xff); | 51 false, 0xff); |
52 } | 52 } |
53 return gp; | 53 return gp; |
54 } | 54 } |
55 | 55 |
56 class AAFillRectBatch : public GrBatch { | 56 class AAFillRectBatch : public GrBatch { |
57 public: | 57 public: |
58 struct Geometry { | 58 struct Geometry { |
59 GrColor fColor; | 59 GrColor fColor; |
60 SkMatrix fViewMatrix; | 60 SkMatrix fViewMatrix; |
61 SkRect fRect; | 61 SkRect fRect; |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 viewMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2); | 891 viewMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2); |
892 | 892 |
893 if (devInside.isEmpty()) { | 893 if (devInside.isEmpty()) { |
894 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); | 894 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); |
895 return; | 895 return; |
896 } | 896 } |
897 | 897 |
898 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, | 898 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, |
899 devOutsideAssist, devInside, true); | 899 devOutsideAssist, devInside, true); |
900 } | 900 } |
OLD | NEW |