| 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 "GrAAFillRectBatch.h" |
| 12 #include "GrColor.h" | 12 #include "GrColor.h" |
| 13 #include "GrNonAAFillRectBatch.h" | 13 #include "GrNonAAFillRectBatch.h" |
| 14 #include "GrNonAAStrokeRectBatch.h" |
| 14 | 15 |
| 15 class GrBatch; | 16 class GrBatch; |
| 16 class SkMatrix; | 17 class SkMatrix; |
| 17 struct SkRect; | 18 struct SkRect; |
| 18 class SkStrokeRec; | 19 class SkStrokeRec; |
| 19 | 20 |
| 20 /* | 21 /* |
| 21 * A factory for returning batches which can draw rectangles. | 22 * A factory for returning batches which can draw rectangles. |
| 22 */ | 23 */ |
| 23 namespace GrRectBatchFactory { | 24 namespace GrRectBatchFactory { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 } | 39 } |
| 39 | 40 |
| 40 inline GrDrawBatch* CreateAAFill(GrColor color, | 41 inline GrDrawBatch* CreateAAFill(GrColor color, |
| 41 const SkMatrix& viewMatrix, | 42 const SkMatrix& viewMatrix, |
| 42 const SkMatrix& localMatrix, | 43 const SkMatrix& localMatrix, |
| 43 const SkRect& rect, | 44 const SkRect& rect, |
| 44 const SkRect& devRect) { | 45 const SkRect& devRect) { |
| 45 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe
ct); | 46 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe
ct); |
| 46 } | 47 } |
| 47 | 48 |
| 48 GrDrawBatch* CreateNonAAStroke(GrColor color, | 49 inline GrDrawBatch* CreateNonAAStroke(GrColor color, |
| 49 const SkMatrix& viewMatrix, | 50 const SkMatrix& viewMatrix, |
| 50 const SkRect& rect, | 51 const SkRect& rect, |
| 51 SkScalar strokeWidth, | 52 SkScalar strokeWidth, |
| 52 bool snapToPixelCenters); | 53 bool snapToPixelCenters) { |
| 54 return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth,
snapToPixelCenters); |
| 55 } |
| 53 | 56 |
| 54 GrDrawBatch* CreateAAStroke(GrColor, | 57 GrDrawBatch* CreateAAStroke(GrColor, |
| 55 const SkMatrix& viewMatrix, | 58 const SkMatrix& viewMatrix, |
| 56 const SkRect& rect, | 59 const SkRect& rect, |
| 57 const SkRect& devRect, | 60 const SkRect& devRect, |
| 58 const SkStrokeRec& stroke); | 61 const SkStrokeRec& stroke); |
| 59 | 62 |
| 60 // First rect is outer; second rect is inner | 63 // First rect is outer; second rect is inner |
| 61 GrDrawBatch* CreateAAFillNestedRects(GrColor, | 64 GrDrawBatch* CreateAAFillNestedRects(GrColor, |
| 62 const SkMatrix& viewMatrix, | 65 const SkMatrix& viewMatrix, |
| 63 const SkRect rects[2]); | 66 const SkRect rects[2]); |
| 64 | 67 |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 #endif | 70 #endif |
| OLD | NEW |