1 /* 2 * Copyright 2015 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrDrawOpTest_DEFINED 9 #define GrDrawOpTest_DEFINED 10 11 #include "GrTestUtils.h" 12 #include "SkRefCnt.h" 13 14 #if GR_TEST_UTILS 15 16 class GrContext; 17 class GrMeshDrawOp; 18 class SkRandom; 19 20 /** This function returns a randomly configured GrDrawOp for testing purposes. */ 21 std::unique_ptr<GrMeshDrawOp> GrRandomDrawOp(SkRandom*, GrContext*); 22 23 /** GrDrawOp subclasses should define test factory functions using this macro. */ 24 #define DRAW_OP_TEST_DEFINE(Op) \ 25 std::unique_ptr<GrMeshDrawOp> Op##__Test(SkRandom* random, GrContext* context) 26 27 /** This macro may be used if the test factory function must be made a friend of a class. */ 28 #define DRAW_OP_TEST_FRIEND(Op) \ 29 friend std::unique_ptr<GrMeshDrawOp> Op##__Test(SkRandom* random, GrContext* context); 30 31 #endif 32 #endif 33