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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 helper.recordDraw(target, gp); | 95 helper.recordDraw(target, gp); |
96 } | 96 } |
97 | 97 |
98 int fNumAttribs; | 98 int fNumAttribs; |
99 | 99 |
100 typedef GrVertexBatch INHERITED; | 100 typedef GrVertexBatch INHERITED; |
101 }; | 101 }; |
102 } | 102 } |
103 | 103 |
104 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { | 104 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { |
105 GrContext* context = ctxInfo.fGrContext; | 105 GrContext* context = ctxInfo.grContext(); |
106 | 106 |
107 sk_sp<GrDrawContext> dc(context->newDrawContext(SkBackingFit::kApprox, | 107 sk_sp<GrDrawContext> dc(context->newDrawContext(SkBackingFit::kApprox, |
108 1, 1, kRGBA_8888_GrPixelConf
ig)); | 108 1, 1, kRGBA_8888_GrPixelConf
ig)); |
109 if (!dc) { | 109 if (!dc) { |
110 ERRORF(reporter, "Could not create draw context."); | 110 ERRORF(reporter, "Could not create draw context."); |
111 return; | 111 return; |
112 } | 112 } |
113 int attribCnt = context->caps()->maxVertexAttributes(); | 113 int attribCnt = context->caps()->maxVertexAttributes(); |
114 if (!attribCnt) { | 114 if (!attribCnt) { |
115 ERRORF(reporter, "No attributes allowed?!"); | 115 ERRORF(reporter, "No attributes allowed?!"); |
(...skipping 20 matching lines...) Expand all Loading... |
136 // This one should fail. | 136 // This one should fail. |
137 batch.reset(new Batch(attribCnt+1)); | 137 batch.reset(new Batch(attribCnt+1)); |
138 dc->drawContextPriv().testingOnly_drawBatch(pb, batch); | 138 dc->drawContextPriv().testingOnly_drawBatch(pb, batch); |
139 context->flush(); | 139 context->flush(); |
140 #if GR_GPU_STATS | 140 #if GR_GPU_STATS |
141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); | 141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); |
142 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; | 142 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; |
143 #endif | 143 #endif |
144 } | 144 } |
145 #endif | 145 #endif |
OLD | NEW |