OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 // This is a GPU-backend specific test. It relies on static intializers to work | 8 // This is a GPU-backend specific test. It relies on static intializers to work |
9 | 9 |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 GrBatchToXPOverrides* overrides) const ove
rride { | 34 GrBatchToXPOverrides* overrides) const ove
rride { |
35 color->setUnknownFourComponents(); | 35 color->setUnknownFourComponents(); |
36 coverage->setUnknownSingleComponent(); | 36 coverage->setUnknownSingleComponent(); |
37 } | 37 } |
38 | 38 |
39 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {} | 39 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {} |
40 | 40 |
41 Batch(int numAttribs) | 41 Batch(int numAttribs) |
42 : INHERITED(ClassID()) | 42 : INHERITED(ClassID()) |
43 , fNumAttribs(numAttribs) { | 43 , fNumAttribs(numAttribs) { |
44 this->setBounds(SkRect::MakeWH(1.f, 1.f)); | 44 this->setBounds(SkRect::MakeWH(1.f, 1.f), HasAABloat::kNo, IsZeroArea::k
No); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } | 48 bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } |
49 void onPrepareDraws(Target* target) const override { | 49 void onPrepareDraws(Target* target) const override { |
50 class GP : public GrGeometryProcessor { | 50 class GP : public GrGeometryProcessor { |
51 public: | 51 public: |
52 GP(int numAttribs) { | 52 GP(int numAttribs) { |
53 this->initClassID<GP>(); | 53 this->initClassID<GP>(); |
54 SkASSERT(numAttribs > 1); | 54 SkASSERT(numAttribs > 1); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // This one should fail. | 135 // This one should fail. |
136 batch.reset(new Batch(attribCnt+1)); | 136 batch.reset(new Batch(attribCnt+1)); |
137 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); | 137 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); |
138 context->flush(); | 138 context->flush(); |
139 #if GR_GPU_STATS | 139 #if GR_GPU_STATS |
140 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); | 140 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); |
141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; | 141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; |
142 #endif | 142 #endif |
143 } | 143 } |
144 #endif | 144 #endif |
OLD | NEW |