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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 * If strokeInfo == NULL, then the rect is filled. | 93 * If strokeInfo == NULL, then the rect is filled. |
94 * Otherwise, if stroke width == 0, then the stroke | 94 * Otherwise, if stroke width == 0, then the stroke |
95 * is always a single pixel thick, else the rect is | 95 * is always a single pixel thick, else the rect is |
96 * mitered/beveled stroked based on stroke width. | 96 * mitered/beveled stroked based on stroke width. |
97 * The rects coords are used to access the paint (through texture matrix) | 97 * The rects coords are used to access the paint (through texture matrix) |
98 */ | 98 */ |
99 void drawRect(const GrClip&, | 99 void drawRect(const GrClip&, |
100 const GrPaint& paint, | 100 const GrPaint& paint, |
101 const SkMatrix& viewMatrix, | 101 const SkMatrix& viewMatrix, |
102 const SkRect&, | 102 const SkRect&, |
103 const GrStrokeInfo* strokeInfo = nullptr); | 103 const GrStrokeInfo* strokeInfo = NULL); |
104 | 104 |
105 /** | 105 /** |
106 * Maps a rectangle of shader coordinates to a rectangle and fills that rect
angle. | 106 * Maps a rectangle of shader coordinates to a rectangle and fills that rect
angle. |
107 * | 107 * |
108 * @param paint describes how to color pixels. | 108 * @param paint describes how to color pixels. |
109 * @param viewMatrix transformation matrix which applies to rectToDraw | 109 * @param viewMatrix transformation matrix which applies to rectToDraw |
110 * @param rectToDraw the rectangle to draw | 110 * @param rectToDraw the rectangle to draw |
111 * @param localRect the rectangle of shader coordinates applied to rectT
oDraw | 111 * @param localRect the rectangle of shader coordinates applied to rectT
oDraw |
112 */ | 112 */ |
113 void fillRectToRect(const GrClip&, | 113 void fillRectToRect(const GrClip&, |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 GrAuditTrail* auditTrail() { return fAuditTrail; } | 273 GrAuditTrail* auditTrail() { return fAuditTrail; } |
274 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } | 274 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } |
275 | 275 |
276 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) | 276 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) |
277 SkDEBUGCODE(void validate() const;) | 277 SkDEBUGCODE(void validate() const;) |
278 | 278 |
279 private: | 279 private: |
280 friend class GrAtlasTextBlob; // for access to drawBatch | 280 friend class GrAtlasTextBlob; // for access to drawBatch |
281 friend class GrDrawingManager; // for ctor | 281 friend class GrDrawingManager; // for ctor |
282 | 282 |
283 void internalDrawPath(const GrClip& clip, | 283 void internalDrawPath(GrPipelineBuilder*, |
284 const GrPaint& paint, | |
285 const SkMatrix& viewMatrix, | 284 const SkMatrix& viewMatrix, |
286 const SkPath& path, | 285 GrColor, |
287 const GrStrokeInfo& strokeInfo); | 286 bool useAA, |
| 287 const SkPath&, |
| 288 const GrStrokeInfo&); |
288 | 289 |
289 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 290 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
290 // the drawTarget. | 291 // the drawTarget. |
291 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 292 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
292 | 293 |
293 GrDrawTarget* getDrawTarget(); | 294 GrDrawTarget* getDrawTarget(); |
294 | 295 |
295 GrDrawingManager* fDrawingManager; | 296 GrDrawingManager* fDrawingManager; |
296 GrRenderTarget* fRenderTarget; | 297 GrRenderTarget* fRenderTarget; |
297 | 298 |
298 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 299 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
299 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 300 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
300 GrDrawTarget* fDrawTarget; | 301 GrDrawTarget* fDrawTarget; |
301 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; | 302 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; |
302 GrContext* fContext; | 303 GrContext* fContext; |
303 | 304 |
304 SkSurfaceProps fSurfaceProps; | 305 SkSurfaceProps fSurfaceProps; |
305 GrAuditTrail* fAuditTrail; | 306 GrAuditTrail* fAuditTrail; |
306 | 307 |
307 // In debug builds we guard against improper thread handling | 308 // In debug builds we guard against improper thread handling |
308 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 309 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
309 }; | 310 }; |
310 | 311 |
311 #endif | 312 #endif |
OLD | NEW |