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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps&) cons
t override { | 64 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps&) cons
t override { |
65 class GLSLGP : public GrGLSLGeometryProcessor { | 65 class GLSLGP : public GrGLSLGeometryProcessor { |
66 public: | 66 public: |
67 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { | 67 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
68 const GP& gp = args.fGP.cast<GP>(); | 68 const GP& gp = args.fGP.cast<GP>(); |
69 args.fVaryingHandler->emitAttributes(gp); | 69 args.fVaryingHandler->emitAttributes(gp); |
70 this->setupPosition(args.fVertBuilder, gpArgs, gp.fAttri
bs[0].fName); | 70 this->setupPosition(args.fVertBuilder, gpArgs, gp.fAttri
bs[0].fName); |
71 } | 71 } |
72 void setData(const GrGLSLProgramDataManager& pdman, | 72 void setData(const GrGLSLProgramDataManager& pdman, |
73 const GrPrimitiveProcessor& primProc, | 73 const GrPrimitiveProcessor& primProc) override
{} |
74 FPCoordTransformIter&&) override {} | |
75 }; | 74 }; |
76 return new GLSLGP(); | 75 return new GLSLGP(); |
77 } | 76 } |
78 void getGLSLProcessorKey(const GrGLSLCaps&, | 77 void getGLSLProcessorKey(const GrGLSLCaps&, |
79 GrProcessorKeyBuilder* builder) const overr
ide { | 78 GrProcessorKeyBuilder* builder) const overr
ide { |
80 builder->add32(this->numAttribs()); | 79 builder->add32(this->numAttribs()); |
81 } | 80 } |
82 | 81 |
83 private: | 82 private: |
84 SkTArray<SkString> fAttribNames; | 83 SkTArray<SkString> fAttribNames; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // This one should fail. | 131 // This one should fail. |
133 batch.reset(new Batch(attribCnt+1)); | 132 batch.reset(new Batch(attribCnt+1)); |
134 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); | 133 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); |
135 context->flush(); | 134 context->flush(); |
136 #if GR_GPU_STATS | 135 #if GR_GPU_STATS |
137 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); | 136 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); |
138 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; | 137 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; |
139 #endif | 138 #endif |
140 } | 139 } |
141 #endif | 140 #endif |
OLD | NEW |