Flutter Engine
The Flutter Engine
GrDrawOpTest.h
Go to the documentation of this file.
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
13
14#if defined(GR_TEST_UTILS)
15
16class GrContext_Base;
17class GrDrawOp;
18class GrPaint;
20namespace skgpu {
21namespace ganesh {
23}
24} // namespace skgpu
26class SkRandom;
27
28/** This function draws a randomly configured GrDrawOp for testing purposes. */
30
31/** GrDrawOp subclasses should define test factory functions using this macro. */
32#define GR_DRAW_OP_TEST_DEFINE(Op) \
33 GrOp::Owner Op##__Test(GrPaint&& paint, \
34 SkRandom* random, \
35 GrRecordingContext* context, \
36 skgpu::ganesh::SurfaceDrawContext* sdc, \
37 int numSamples)
38#define GR_DRAW_OP_TEST_FRIEND(Op) \
39 friend GrOp::OpOwner Op##__Test( \
40 GrPaint&&, SkRandom*, GrRecordingContext*, skgpu::ganesh::SurfaceDrawContext*, int)
41
42/** Helper for op test factories to pick a random stencil state. */
43const GrUserStencilSettings* GrGetRandomStencil(SkRandom* random, GrContext_Base*);
44
45#endif
46#endif
void GrDrawRandomOp(SkRandom *random, skgpu::ganesh::SurfaceDrawContext *sdc, GrPaint &&paint)
Definition: GrTest.cpp:74
Definition: GpuTools.h:21