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 |
| 26 | * space. 'viewMatrix' must be affine. |
| 27 | */ |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 28 | std::unique_ptr<GrDrawOp> Make(GrContext*, |
| 29 | sk_sp<GrTextureProxy>, |
| 30 | GrSamplerState::Filter, |
| 31 | GrColor, |
| 32 | const SkRect& srcRect, |
| 33 | const SkRect& dstRect, |
| 34 | GrAAType, |
| 35 | SkCanvas::SrcRectConstraint, |
| 36 | const SkMatrix& viewMatrix, |
Brian Osman | 3ebd354 | 2018-07-30 14:36:53 -0400 | [diff] [blame] | 37 | sk_sp<GrColorSpaceXform> textureXform, |
| 38 | sk_sp<GrColorSpaceXform> paintXform); |
Brian Salomon | 3416969 | 2017-08-28 15:32:01 -0400 | [diff] [blame] | 39 | } |