| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrRectBatchFactory_DEFINED | 8 #ifndef GrRectBatchFactory_DEFINED |
| 9 #define GrRectBatchFactory_DEFINED | 9 #define GrRectBatchFactory_DEFINED |
| 10 | 10 |
| 11 #include "GrAAFillRectBatch.h" |
| 11 #include "GrColor.h" | 12 #include "GrColor.h" |
| 12 | 13 |
| 13 class GrBatch; | 14 class GrBatch; |
| 14 class SkMatrix; | 15 class SkMatrix; |
| 15 struct SkRect; | 16 struct SkRect; |
| 16 class SkStrokeRec; | 17 class SkStrokeRec; |
| 17 | 18 |
| 18 /* | 19 /* |
| 19 * A factory for returning batches which can draw rectangles. | 20 * A factory for returning batches which can draw rectangles. |
| 20 */ | 21 */ |
| 21 namespace GrRectBatchFactory { | 22 namespace GrRectBatchFactory { |
| 22 | 23 |
| 23 GrBatch* CreateFillBW(GrColor color, | 24 GrBatch* CreateFillBW(GrColor color, |
| 24 const SkMatrix& viewMatrix, | 25 const SkMatrix& viewMatrix, |
| 25 const SkRect& rect, | 26 const SkRect& rect, |
| 26 const SkRect* localRect, | 27 const SkRect* localRect, |
| 27 const SkMatrix* localMatrix); | 28 const SkMatrix* localMatrix); |
| 28 | 29 |
| 29 GrBatch* CreateFillAA(GrColor color, | 30 static GrBatch* CreateFillAA(GrColor color, |
| 30 const SkMatrix& viewMatrix, | 31 const SkMatrix& viewMatrix, |
| 31 const SkRect& rect, | 32 const SkRect& rect, |
| 32 const SkRect& devRect); | 33 const SkRect& devRect) { |
| 34 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect); |
| 35 } |
| 33 | 36 |
| 34 GrBatch* CreateStrokeBW(GrColor color, | 37 GrBatch* CreateStrokeBW(GrColor color, |
| 35 const SkMatrix& viewMatrix, | 38 const SkMatrix& viewMatrix, |
| 36 const SkRect& rect, | 39 const SkRect& rect, |
| 37 SkScalar strokeWidth, | 40 SkScalar strokeWidth, |
| 38 bool snapToPixelCenters); | 41 bool snapToPixelCenters); |
| 39 | 42 |
| 40 GrBatch* CreateStrokeAA(GrColor, | 43 GrBatch* CreateStrokeAA(GrColor, |
| 41 const SkMatrix& viewMatrix, | 44 const SkMatrix& viewMatrix, |
| 42 const SkRect& rect, | 45 const SkRect& rect, |
| 43 const SkRect& devRect, | 46 const SkRect& devRect, |
| 44 const SkStrokeRec& stroke); | 47 const SkStrokeRec& stroke); |
| 45 | 48 |
| 46 // First rect is outer; second rect is inner | 49 // First rect is outer; second rect is inner |
| 47 GrBatch* CreateFillNestedRectsAA(GrColor, | 50 GrBatch* CreateFillNestedRectsAA(GrColor, |
| 48 const SkMatrix& viewMatrix, | 51 const SkMatrix& viewMatrix, |
| 49 const SkRect rects[2]); | 52 const SkRect rects[2]); |
| 50 | 53 |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 #endif | 56 #endif |
| OLD | NEW |