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 GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 * @param strokeInfo the stroke information (width, join, cap) and | 134 * @param strokeInfo the stroke information (width, join, cap) and |
135 * the dash information (intervals, count, phase). | 135 * the dash information (intervals, count, phase). |
136 */ | 136 */ |
137 void drawRRect(const GrClip&, | 137 void drawRRect(const GrClip&, |
138 const GrPaint&, | 138 const GrPaint&, |
139 const SkMatrix& viewMatrix, | 139 const SkMatrix& viewMatrix, |
140 const SkRRect& rrect, | 140 const SkRRect& rrect, |
141 const GrStrokeInfo&); | 141 const GrStrokeInfo&); |
142 | 142 |
143 /** | 143 /** |
| 144 * Shortcut for drawing an SkPath consisting of nested rrects using a paint
. |
| 145 * Does not support stroking. The result is undefined if outer does not con
tain |
| 146 * inner. |
| 147 * |
| 148 * @param paint describes how to color pixels. |
| 149 * @param viewMatrix transformation matrix |
| 150 * @param outer the outer roundrect |
| 151 * @param inner the inner roundrect |
| 152 */ |
| 153 void drawDRRect(const GrClip&, |
| 154 const GrPaint&, |
| 155 const SkMatrix& viewMatrix, |
| 156 const SkRRect& outer, |
| 157 const SkRRect& inner); |
| 158 |
| 159 /** |
144 * Draws a path. | 160 * Draws a path. |
145 * | 161 * |
146 * @param paint describes how to color pixels. | 162 * @param paint describes how to color pixels. |
147 * @param viewMatrix transformation matrix | 163 * @param viewMatrix transformation matrix |
148 * @param path the path to draw | 164 * @param path the path to draw |
149 * @param strokeInfo the stroke information (width, join, cap) and | 165 * @param strokeInfo the stroke information (width, join, cap) and |
150 * the dash information (intervals, count, phase). | 166 * the dash information (intervals, count, phase). |
151 */ | 167 */ |
152 void drawPath(const GrClip&, | 168 void drawPath(const GrClip&, |
153 const GrPaint&, | 169 const GrPaint&, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 GrAuditTrail* auditTrail() { return fAuditTrail; } | 289 GrAuditTrail* auditTrail() { return fAuditTrail; } |
274 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } | 290 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } |
275 | 291 |
276 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) | 292 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) |
277 SkDEBUGCODE(void validate() const;) | 293 SkDEBUGCODE(void validate() const;) |
278 | 294 |
279 private: | 295 private: |
280 friend class GrAtlasTextBlob; // for access to drawBatch | 296 friend class GrAtlasTextBlob; // for access to drawBatch |
281 friend class GrDrawingManager; // for ctor | 297 friend class GrDrawingManager; // for ctor |
282 | 298 |
| 299 bool drawFilledDRRect(const GrClip& clip, |
| 300 const GrPaint& paint, |
| 301 const SkMatrix& viewMatrix, |
| 302 const SkRRect& origOuter, |
| 303 const SkRRect& origInner); |
| 304 |
283 void internalDrawPath(GrPipelineBuilder*, | 305 void internalDrawPath(GrPipelineBuilder*, |
284 const SkMatrix& viewMatrix, | 306 const SkMatrix& viewMatrix, |
285 GrColor, | 307 GrColor, |
286 bool useAA, | 308 bool useAA, |
287 const SkPath&, | 309 const SkPath&, |
288 const GrStrokeInfo&); | 310 const GrStrokeInfo&); |
289 | 311 |
290 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 312 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
291 // the drawTarget. | 313 // the drawTarget. |
292 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 314 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
(...skipping 10 matching lines...) Expand all Loading... |
303 GrContext* fContext; | 325 GrContext* fContext; |
304 | 326 |
305 SkSurfaceProps fSurfaceProps; | 327 SkSurfaceProps fSurfaceProps; |
306 GrAuditTrail* fAuditTrail; | 328 GrAuditTrail* fAuditTrail; |
307 | 329 |
308 // In debug builds we guard against improper thread handling | 330 // In debug builds we guard against improper thread handling |
309 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 331 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
310 }; | 332 }; |
311 | 333 |
312 #endif | 334 #endif |
OLD | NEW |