blob: 491b303d804ac57b25a897d5d5f2bb6bf88fcb31 [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
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050011#include "GrTypesPriv.h"
12#include "SkRefCnt.h"
Brian Salomon199fb872017-02-06 09:41:10 -050013#include "SkVertices.h"
Brian Salomonfc527d22016-12-14 21:07:01 -050014
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050015class GrColorSpaceXform;
16class GrContext;
17class GrDrawOp;
18class GrPaint;
Brian Salomonfc527d22016-12-14 21:07:01 -050019
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050020namespace GrDrawVerticesOp {
Brian Salomonfc527d22016-12-14 21:07:01 -050021
Brian Salomon199fb872017-02-06 09:41:10 -050022 /**
Brian Salomonc2f42542017-07-12 14:11:22 -040023 * Draw a SkVertices. The GrPaint param's color is used if the vertices lack per-vertex color.
24 * If the vertices lack local coords then the vertex positions are used as local coords. The
25 * primitive type drawn is derived from the SkVertices object, unless overridePrimType is
Brian Osman08a50e02018-06-15 15:06:48 -040026 * specified.
Brian Salomon199fb872017-02-06 09:41:10 -050027 */
Robert Phillipsb6e9d3c2019-02-11 14:29:34 -050028 std::unique_ptr<GrDrawOp> Make(GrContext*,
29 GrPaint&&,
30 sk_sp<SkVertices>,
31 const SkVertices::Bone bones[],
32 int boneCount,
33 const SkMatrix& viewMatrix,
34 GrAAType,
35 sk_sp<GrColorSpaceXform>,
36 GrPrimitiveType* overridePrimType = nullptr);
Brian Salomonfc527d22016-12-14 21:07:01 -050037};
38
39#endif