blob: 96cbc70cb85b42f5251cb49e1e684d4b3d7c706f [file] [log] [blame]
Brian Salomon34169692017-08-28 15:32:01 -04001/*
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 Salomon2bbdcc42017-09-07 12:36:34 -04009#include "GrSamplerState.h"
Brian Salomon485b8c62018-01-12 15:11:06 -050010#include "GrTypesPriv.h"
Brian Salomonb80ffee2018-05-23 16:39:39 -040011#include "SkCanvas.h"
Brian Osmand49e9462017-10-16 13:17:48 -040012#include "SkRefCnt.h"
Brian Salomon34169692017-08-28 15:32:01 -040013
Brian Osmand49e9462017-10-16 13:17:48 -040014class GrColorSpaceXform;
Brian Salomon34169692017-08-28 15:32:01 -040015class GrDrawOp;
16class GrTextureProxy;
17struct SkRect;
18class SkMatrix;
19
20namespace GrTextureOp {
Brian Salomonb80ffee2018-05-23 16:39:39 -040021
Brian Salomon34169692017-08-28 15:32:01 -040022/**
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 Phillips7c525e62018-06-12 10:11:12 -040028std::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 Osman3ebd3542018-07-30 14:36:53 -040037 sk_sp<GrColorSpaceXform> textureXform,
38 sk_sp<GrColorSpaceXform> paintXform);
Brian Salomon34169692017-08-28 15:32:01 -040039}