blob: 4cee5fd080b3f3f2c792f2116b4ad1d531623e75 [file] [log] [blame]
Brian Salomonfc527d22016-12-14 21:07:01 -05001/*
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 GrDrawVerticesOp_DEFINED
9#define GrDrawVerticesOp_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkRefCnt.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050012#include "include/private/GrTypesPriv.h"
Brian Salomonfc527d22016-12-14 21:07:01 -050013
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050014class GrColorSpaceXform;
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050015class GrDrawOp;
16class GrPaint;
Robert Phillipsb97da532019-02-12 15:24:12 -050017class GrRecordingContext;
Brian Osman449b1152020-04-15 16:43:00 -040018class SkMatrixProvider;
Brian Osman3c358422020-03-23 10:44:12 -040019class SkRuntimeEffect;
Brian Salomonfc527d22016-12-14 21:07:01 -050020
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050021namespace GrDrawVerticesOp {
Brian Salomonfc527d22016-12-14 21:07:01 -050022
Brian Salomon199fb872017-02-06 09:41:10 -050023 /**
Brian Salomonc2f42542017-07-12 14:11:22 -040024 * Draw a SkVertices. The GrPaint param's color is used if the vertices lack per-vertex color.
25 * If the vertices lack local coords then the vertex positions are used as local coords. The
26 * primitive type drawn is derived from the SkVertices object, unless overridePrimType is
Brian Osman3c358422020-03-23 10:44:12 -040027 * specified. If an SkRuntimeEffect is provided, it may expect some number of input varyings,
28 * which should match the number of extra per-vertex values in the SkVertices.
Brian Salomon199fb872017-02-06 09:41:10 -050029 */
Robert Phillipsb97da532019-02-12 15:24:12 -050030 std::unique_ptr<GrDrawOp> Make(GrRecordingContext*,
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050031 GrPaint&&,
32 sk_sp<SkVertices>,
Brian Osman449b1152020-04-15 16:43:00 -040033 const SkMatrixProvider&,
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050034 GrAAType,
35 sk_sp<GrColorSpaceXform>,
Brian Osmanaa9983a2020-04-02 16:49:59 -040036 GrPrimitiveType* overridePrimType,
Brian Osman449b1152020-04-15 16:43:00 -040037 const SkRuntimeEffect*);
Brian Osman3c358422020-03-23 10:44:12 -040038
Brian Salomonfc527d22016-12-14 21:07:01 -050039};
40
41#endif