Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: src/gpu/batches/GrRectBatchFactory.h

Issue 1293543002: drawBitmapImage can batch across AA rects (Closed) Base URL: https://skia.googlesource.com/skia.git@gmfordrawimagerect
Patch Set: tweaks Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrAAFillRectBatch.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrBWFillRectBatch.h" 12 #include "GrBWFillRectBatch.h"
13 #include "GrColor.h" 13 #include "GrColor.h"
14 14
15 class GrBatch; 15 class GrBatch;
16 class SkMatrix; 16 class SkMatrix;
17 struct SkRect; 17 struct SkRect;
18 class SkStrokeRec; 18 class SkStrokeRec;
19 19
20 /* 20 /*
21 * A factory for returning batches which can draw rectangles. 21 * A factory for returning batches which can draw rectangles.
22 */ 22 */
23 namespace GrRectBatchFactory { 23 namespace GrRectBatchFactory {
24 24
25 inline GrDrawBatch* CreateFillBW(GrColor color, 25 inline GrDrawBatch* CreateFillBW(GrColor color,
26 const SkMatrix& viewMatrix, 26 const SkMatrix& viewMatrix,
27 const SkRect& rect, 27 const SkRect& rect,
28 const SkRect* localRect, 28 const SkRect* localRect,
29 const SkMatrix* localMatrix) { 29 const SkMatrix* localMatrix) {
30 return GrBWFillRectBatch::Create(color, viewMatrix, rect, localRect, localMa trix); 30 return GrBWFillRectBatch::Create(color, viewMatrix, rect, localRect, localMa trix);
31 } 31 }
32 32
33 inline GrDrawBatch* CreateFillAA(GrColor color, 33 inline GrDrawBatch* CreateFillAA(GrColor color,
34 const SkMatrix& viewMatrix, 34 const SkMatrix& viewMatrix,
35 const SkRect& rect, 35 const SkRect& rect,
36 const SkRect& devRect) { 36 const SkRect& devRect) {
37 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect); 37 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect);
38 } 38 }
39 39
40 inline GrDrawBatch* CreateFillAA(GrColor color,
41 const SkMatrix& viewMatrix,
42 const SkMatrix& localMatrix,
43 const SkRect& rect,
44 const SkRect& devRect) {
45 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct);
46 }
47
40 GrDrawBatch* CreateStrokeBW(GrColor color, 48 GrDrawBatch* CreateStrokeBW(GrColor color,
41 const SkMatrix& viewMatrix, 49 const SkMatrix& viewMatrix,
42 const SkRect& rect, 50 const SkRect& rect,
43 SkScalar strokeWidth, 51 SkScalar strokeWidth,
44 bool snapToPixelCenters); 52 bool snapToPixelCenters);
45 53
46 GrDrawBatch* CreateStrokeAA(GrColor, 54 GrDrawBatch* CreateStrokeAA(GrColor,
47 const SkMatrix& viewMatrix, 55 const SkMatrix& viewMatrix,
48 const SkRect& rect, 56 const SkRect& rect,
49 const SkRect& devRect, 57 const SkRect& devRect,
50 const SkStrokeRec& stroke); 58 const SkStrokeRec& stroke);
51 59
52 // First rect is outer; second rect is inner 60 // First rect is outer; second rect is inner
53 GrDrawBatch* CreateFillNestedRectsAA(GrColor, 61 GrDrawBatch* CreateFillNestedRectsAA(GrColor,
54 const SkMatrix& viewMatrix, 62 const SkMatrix& viewMatrix,
55 const SkRect rects[2]); 63 const SkRect rects[2]);
56 64
57 }; 65 };
58 66
59 #endif 67 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAAFillRectBatch.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698