OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "gm.h" | 8 #include "gm.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 int y = kPad; | 67 int y = kPad; |
68 int x = kPad; | 68 int x = kPad; |
69 static const GrPrimitiveEdgeType kEdgeTypes[] = { | 69 static const GrPrimitiveEdgeType kEdgeTypes[] = { |
70 kFillAA_GrProcessorEdgeType, | 70 kFillAA_GrProcessorEdgeType, |
71 kInverseFillAA_GrProcessorEdgeType, | 71 kInverseFillAA_GrProcessorEdgeType, |
72 }; | 72 }; |
73 SkRect testBounds = SkRect::MakeIWH(fTestWidth, fTestHeight); | 73 SkRect testBounds = SkRect::MakeIWH(fTestWidth, fTestHeight); |
74 for (size_t et = 0; et < SK_ARRAY_COUNT(kEdgeTypes); ++et) { | 74 for (size_t et = 0; et < SK_ARRAY_COUNT(kEdgeTypes); ++et) { |
75 GrPrimitiveEdgeType edgeType = kEdgeTypes[et]; | 75 GrPrimitiveEdgeType edgeType = kEdgeTypes[et]; |
76 canvas->save(); | 76 canvas->save(); |
77 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
| 77 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
78 | 78 |
79 // Draw a background for the test case | 79 // Draw a background for the test case |
80 SkPaint paint; | 80 SkPaint paint; |
81 paint.setColor(SK_ColorWHITE); | 81 paint.setColor(SK_ColorWHITE); |
82 canvas->drawRect(testBounds, paint); | 82 canvas->drawRect(testBounds, paint); |
83 | 83 |
84 GrPipelineBuilder pipelineBuilder; | 84 GrPipelineBuilder pipelineBuilder; |
85 pipelineBuilder.setXPFactory( | 85 pipelineBuilder.setXPFactory( |
86 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref
(); | 86 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref
(); |
87 | 87 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize,
kSize)), "rect"); ) | 131 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize,
kSize)), "rect"); ) |
132 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize,
kSize)), "circle"); ) | 132 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize,
kSize)), "circle"); ) |
133 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize -
1, kSize - 10)), "ellipse"); ) | 133 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize -
1, kSize - 10)), "ellipse"); ) |
134 // The next two have small linear segments between the corners | 134 // The next two have small linear segments between the corners |
135 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize
- 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 10.f), "circular_corner"); ) | 135 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize
- 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 10.f), "circular_corner"); ) |
136 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize
- 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); ) | 136 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize
- 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); ) |
137 | 137 |
138 } | 138 } |
139 #endif | 139 #endif |
OLD | NEW |