| 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) override
{} | 73 const GrPrimitiveProcessor& primProc, |
| 74 FPCoordTransformIter&&) override {} |
| 74 }; | 75 }; |
| 75 return new GLSLGP(); | 76 return new GLSLGP(); |
| 76 } | 77 } |
| 77 void getGLSLProcessorKey(const GrGLSLCaps&, | 78 void getGLSLProcessorKey(const GrGLSLCaps&, |
| 78 GrProcessorKeyBuilder* builder) const overr
ide { | 79 GrProcessorKeyBuilder* builder) const overr
ide { |
| 79 builder->add32(this->numAttribs()); | 80 builder->add32(this->numAttribs()); |
| 80 } | 81 } |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 SkTArray<SkString> fAttribNames; | 84 SkTArray<SkString> fAttribNames; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // This one should fail. | 132 // This one should fail. |
| 132 batch.reset(new Batch(attribCnt+1)); | 133 batch.reset(new Batch(attribCnt+1)); |
| 133 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); | 134 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); |
| 134 context->flush(); | 135 context->flush(); |
| 135 #if GR_GPU_STATS | 136 #if GR_GPU_STATS |
| 136 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); | 137 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); |
| 137 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; | 138 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1)
; |
| 138 #endif | 139 #endif |
| 139 } | 140 } |
| 140 #endif | 141 #endif |
| OLD | NEW |