• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 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 GrAnalyticRectOp_DEFINED
9 #define GrAnalyticRectOp_DEFINED
10 
11 #include "GrColor.h"
12 #include "SkRefCnt.h"
13 
14 class GrMeshDrawOp;
15 class SkMatrix;
16 struct SkRect;
17 
18 /*
19  * This class wraps helper functions that draw rects analytically. Used when a shader requires a
20  * distance vector.
21  *
22  * @param color        the shape's color
23  * @param viewMatrix   the shape's local matrix
24  * @param rect         the shape in source space
25  * @param croppedRect  the shape in device space, clipped to the device's bounds
26  * @param bounds       the axis aligned bounds of the shape in device space
27  */
28 class GrAnalyticRectOp {
29 public:
30     static std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
31                                               const SkMatrix& viewMatrix,
32                                               const SkRect& rect,
33                                               const SkRect& croppedRect,
34                                               const SkRect& bounds);
35 };
36 
37 #endif  // GrAnalyticRectOp_DEFINED
38