Brian Salomon | fc527d2 | 2016-12-14 21:07:01 -0500 | [diff] [blame] | 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 GrDrawVerticesOp_DEFINED |
| 9 | #define GrDrawVerticesOp_DEFINED |
| 10 | |
Robert Phillips | b6e9d3c | 2019-02-11 14:29:34 -0500 | [diff] [blame] | 11 | #include "GrTypesPriv.h" |
| 12 | #include "SkRefCnt.h" |
Brian Salomon | 199fb87 | 2017-02-06 09:41:10 -0500 | [diff] [blame] | 13 | #include "SkVertices.h" |
Brian Salomon | fc527d2 | 2016-12-14 21:07:01 -0500 | [diff] [blame] | 14 | |
Robert Phillips | b6e9d3c | 2019-02-11 14:29:34 -0500 | [diff] [blame] | 15 | class GrColorSpaceXform; |
| 16 | class GrContext; |
| 17 | class GrDrawOp; |
| 18 | class GrPaint; |
Brian Salomon | fc527d2 | 2016-12-14 21:07:01 -0500 | [diff] [blame] | 19 | |
Robert Phillips | b6e9d3c | 2019-02-11 14:29:34 -0500 | [diff] [blame] | 20 | namespace GrDrawVerticesOp { |
Brian Salomon | fc527d2 | 2016-12-14 21:07:01 -0500 | [diff] [blame] | 21 | |
Brian Salomon | 199fb87 | 2017-02-06 09:41:10 -0500 | [diff] [blame] | 22 | /** |
Brian Salomon | c2f4254 | 2017-07-12 14:11:22 -0400 | [diff] [blame] | 23 | * 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 Osman | 08a50e0 | 2018-06-15 15:06:48 -0400 | [diff] [blame] | 26 | * specified. |
Brian Salomon | 199fb87 | 2017-02-06 09:41:10 -0500 | [diff] [blame] | 27 | */ |
Robert Phillips | b6e9d3c | 2019-02-11 14:29:34 -0500 | [diff] [blame] | 28 | 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 Salomon | fc527d2 | 2016-12-14 21:07:01 -0500 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | #endif |