1 /*
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 #include "GrRectBatchFactory.h"
9
10 #include "GrAAStrokeRectBatch.h"
11
12 #include "SkStrokeRec.h"
13
14 namespace GrRectBatchFactory {
15
CreateAAFillNestedRects(GrColor color,const SkMatrix & viewMatrix,const SkRect rects[2])16 GrDrawBatch* CreateAAFillNestedRects(GrColor color,
17 const SkMatrix& viewMatrix,
18 const SkRect rects[2]) {
19 SkASSERT(viewMatrix.rectStaysRect());
20 SkASSERT(!rects[0].isEmpty() && !rects[1].isEmpty());
21
22 SkRect devOutside, devInside;
23 viewMatrix.mapRect(&devOutside, rects[0]);
24 viewMatrix.mapRect(&devInside, rects[1]);
25
26 return GrAAStrokeRectBatch::Create(color, viewMatrix, devOutside, devOutside, devInside, true,
27 devInside.isEmpty());
28 }
29
30 };
31