Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 | #include "GrColor.h" |
Brian Salomon | 2bbdcc4 | 2017-09-07 12:36:34 -0400 | [diff] [blame] | 9 | #include "GrSamplerState.h" |
Brian Salomon | 485b8c6 | 2018-01-12 15:11:06 -0500 | [diff] [blame] | 10 | #include "GrTypesPriv.h" |
Brian Salomon | b80ffee | 2018-05-23 16:39:39 -0400 | [diff] [blame] | 11 | #include "SkCanvas.h" |
Brian Osman | d49e946 | 2017-10-16 13:17:48 -0400 | [diff] [blame] | 12 | #include "SkRefCnt.h" |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 13 | |
Brian Osman | d49e946 | 2017-10-16 13:17:48 -0400 | [diff] [blame] | 14 | class GrColorSpaceXform; |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 15 | class GrDrawOp; |
| 16 | class GrTextureProxy; |
| 17 | struct SkRect; |
| 18 | class SkMatrix; |
| 19 | |
| 20 | namespace GrTextureOp { |
Brian Salomon | b80ffee | 2018-05-23 16:39:39 -0400 | [diff] [blame] | 21 | |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 22 | /** |
| 23 | * Creates an op that draws a sub-rectangle of a texture. The passed color is modulated by the |
| 24 | * texture's color. 'srcRect' specifies the rectangle of the texture to draw. 'dstRect' specifies |
| 25 | * the rectangle to draw in local coords which will be transformed by 'viewMatrix' to be in device |
Brian Salomon | 2213ee9 | 2018-10-02 10:44:21 -0400 | [diff] [blame^] | 26 | * space. 'viewMatrix' must be affine. If GrAAType is kCoverage then AA is applied to the edges |
| 27 | * indicated by GrQuadAAFlags. Otherwise, GrQuadAAFlags is ignored. |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 28 | */ |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 29 | std::unique_ptr<GrDrawOp> Make(GrContext*, |
| 30 | sk_sp<GrTextureProxy>, |
| 31 | GrSamplerState::Filter, |
| 32 | GrColor, |
| 33 | const SkRect& srcRect, |
| 34 | const SkRect& dstRect, |
| 35 | GrAAType, |
Brian Salomon | 2213ee9 | 2018-10-02 10:44:21 -0400 | [diff] [blame^] | 36 | GrQuadAAFlags, |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 37 | SkCanvas::SrcRectConstraint, |
| 38 | const SkMatrix& viewMatrix, |
Brian Osman | 3ebd354 | 2018-07-30 14:36:53 -0400 | [diff] [blame] | 39 | sk_sp<GrColorSpaceXform> textureXform, |
| 40 | sk_sp<GrColorSpaceXform> paintXform); |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 41 | } |