blob: 6dc9541d77564d5f8779799374ea952307035f24 [file] [log] [blame]
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrDrawOpTest_DEFINED
#define GrDrawOpTest_DEFINED
#include "GrTestUtils.h"
#include "SkRefCnt.h"
#if GR_TEST_UTILS
class GrDrawOp;
class GrPaint;
class GrRenderTargetContext;
struct GrUserStencilSettings;
class SkRandom;
/** This function draws a randomly configured GrDrawOp for testing purposes. */
void GrDrawRandomOp(SkRandom*, GrRenderTargetContext*, GrPaint&&);
/** GrDrawOp subclasses should define test factory functions using this macro. */
#define GR_DRAW_OP_TEST_DEFINE(Op) \
std::unique_ptr<GrDrawOp> Op##__Test(GrPaint&& paint, SkRandom* random, GrContext* context, \
GrFSAAType fsaaType)
#define GR_DRAW_OP_TEST_FRIEND(Op) \
friend std::unique_ptr<GrDrawOp> Op##__Test(GrPaint&& paint, SkRandom* random, \
GrContext* context, GrFSAAType fsaaType)
/** Helper for op test factories to pick a random stencil state. */
const GrUserStencilSettings* GrGetRandomStencil(SkRandom* random, GrContext*);
#endif
#endif