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" |
11 #include "GrDrawContext.h" | 11 #include "GrDrawContextPriv.h" |
12 #include "GrPipelineBuilder.h" | 12 #include "GrPipelineBuilder.h" |
13 #include "SkDevice.h" | 13 #include "SkDevice.h" |
14 #include "SkRRect.h" | 14 #include "SkRRect.h" |
15 #include "batches/GrDrawBatch.h" | 15 #include "batches/GrDrawBatch.h" |
16 #include "batches/GrRectBatchFactory.h" | 16 #include "batches/GrRectBatchFactory.h" |
17 #include "effects/GrRRectEffect.h" | 17 #include "effects/GrRRectEffect.h" |
18 | 18 |
19 namespace skiagm { | 19 namespace skiagm { |
20 | 20 |
21 /////////////////////////////////////////////////////////////////////////////// | 21 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (fp) { | 92 if (fp) { |
93 pipelineBuilder.addCoverageFragmentProcessor(fp); | 93 pipelineBuilder.addCoverageFragmentProcessor(fp); |
94 pipelineBuilder.setRenderTarget(rt); | 94 pipelineBuilder.setRenderTarget(rt); |
95 | 95 |
96 SkRect bounds = testBounds; | 96 SkRect bounds = testBounds; |
97 bounds.offset(SkIntToScalar(x), SkIntToScalar(y)); | 97 bounds.offset(SkIntToScalar(x), SkIntToScalar(y)); |
98 | 98 |
99 SkAutoTUnref<GrDrawBatch> batch( | 99 SkAutoTUnref<GrDrawBatch> batch( |
100 GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMa
trix::I(), bounds, | 100 GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMa
trix::I(), bounds, |
101 nullptr, nullptr
)); | 101 nullptr, nullptr
)); |
102 drawContext->internal_drawBatch(pipelineBuilder, batch); | 102 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
103 } | 103 } |
104 canvas->restore(); | 104 canvas->restore(); |
105 x = x + fTestOffsetX; | 105 x = x + fTestOffsetX; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 private: | 109 private: |
110 // pad between test cases | 110 // pad between test cases |
111 static const int kPad = 7; | 111 static const int kPad = 7; |
112 // gap between rect for each case that is rendered and exterior of rrect | 112 // gap between rect for each case that is rendered and exterior of rrect |
(...skipping 17 matching lines...) Expand all 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 |