blob: d6fe67398d77a06d5a125c723f1dc1580e6593b9 [file] [log] [blame]
joshualittecd1a692015-08-10 10:08:26 -07001/*
2 * Copyright 2015 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 GrRectBatchFactory_DEFINED
9#define GrRectBatchFactory_DEFINED
10
11#include "GrColor.h"
12
13class GrBatch;
14class SkMatrix;
15struct SkRect;
joshualitt14205b12015-08-10 11:40:56 -070016class SkStrokeRec;
joshualittecd1a692015-08-10 10:08:26 -070017
18/*
joshualitt14205b12015-08-10 11:40:56 -070019 * A factory for returning batches which can draw rectangles.
joshualittecd1a692015-08-10 10:08:26 -070020 */
21namespace GrRectBatchFactory {
22
joshualitt7fc2a262015-08-10 10:30:14 -070023GrBatch* CreateFillBW(GrColor color,
24 const SkMatrix& viewMatrix,
25 const SkRect& rect,
26 const SkRect* localRect,
27 const SkMatrix* localMatrix);
28
joshualitt14205b12015-08-10 11:40:56 -070029GrBatch* CreateFillAA(GrColor color,
30 const SkMatrix& viewMatrix,
31 const SkRect& rect,
32 const SkRect& devRect);
33
joshualitt7fc2a262015-08-10 10:30:14 -070034GrBatch* CreateStrokeBW(GrColor color,
35 const SkMatrix& viewMatrix,
36 const SkRect& rect,
37 SkScalar strokeWidth,
38 bool snapToPixelCenters);
joshualittecd1a692015-08-10 10:08:26 -070039
joshualitt14205b12015-08-10 11:40:56 -070040GrBatch* CreateStrokeAA(GrColor,
41 const SkMatrix& viewMatrix,
42 const SkRect& rect,
43 const SkRect& devRect,
44 const SkStrokeRec& stroke);
45
46// First rect is outer; second rect is inner
47GrBatch* CreateFillNestedRectsAA(GrColor,
48 const SkMatrix& viewMatrix,
49 const SkRect rects[2]);
50
joshualittecd1a692015-08-10 10:08:26 -070051};
52
53#endif