Home | History | Annotate | Download | only in ops
      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"
      9 #include "GrSamplerState.h"
     10 #include "GrTypesPriv.h"
     11 #include "SkRefCnt.h"
     12 
     13 class GrColorSpaceXform;
     14 class GrDrawOp;
     15 class GrTextureProxy;
     16 struct SkRect;
     17 class SkMatrix;
     18 
     19 namespace GrTextureOp {
     20 /**
     21  * Creates an op that draws a sub-rectangle of a texture. The passed color is modulated by the
     22  * texture's color. 'srcRect' specifies the rectangle of the texture to draw. 'dstRect' specifies
     23  * the rectangle to draw in local coords which will be transformed by 'viewMatrix' to be in device
     24  * space. 'viewMatrix' must be affine.
     25  */
     26 std::unique_ptr<GrDrawOp> Make(sk_sp<GrTextureProxy>, GrSamplerState::Filter, GrColor,
     27                                const SkRect& srcRect, const SkRect& dstRect, GrAAType,
     28                                const SkMatrix& viewMatrix, sk_sp<GrColorSpaceXform>,
     29                                bool allowSRGBInputs);
     30 }
     31