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 = NULL); | 103 const GrStrokeInfo* strokeInfo = nullptr); |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 private: | 295 private: |
296 friend class GrAtlasTextBlob; // for access to drawBatch | 296 friend class GrAtlasTextBlob; // for access to drawBatch |
297 friend class GrDrawingManager; // for ctor | 297 friend class GrDrawingManager; // for ctor |
298 | 298 |
299 bool drawFilledDRRect(const GrClip& clip, | 299 bool drawFilledDRRect(const GrClip& clip, |
300 const GrPaint& paint, | 300 const GrPaint& paint, |
301 const SkMatrix& viewMatrix, | 301 const SkMatrix& viewMatrix, |
302 const SkRRect& origOuter, | 302 const SkRRect& origOuter, |
303 const SkRRect& origInner); | 303 const SkRRect& origInner); |
304 | 304 |
305 void internalDrawPath(GrPipelineBuilder*, | 305 void internalDrawPath(const GrClip& clip, |
| 306 const GrPaint& paint, |
306 const SkMatrix& viewMatrix, | 307 const SkMatrix& viewMatrix, |
307 GrColor, | 308 const SkPath& path, |
308 bool useAA, | 309 const GrStrokeInfo& strokeInfo); |
309 const SkPath&, | |
310 const GrStrokeInfo&); | |
311 | 310 |
312 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 311 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
313 // the drawTarget. | 312 // the drawTarget. |
314 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 313 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
315 | 314 |
316 GrDrawTarget* getDrawTarget(); | 315 GrDrawTarget* getDrawTarget(); |
317 | 316 |
318 GrDrawingManager* fDrawingManager; | 317 GrDrawingManager* fDrawingManager; |
319 GrRenderTarget* fRenderTarget; | 318 GrRenderTarget* fRenderTarget; |
320 | 319 |
321 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 320 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
322 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 321 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
323 GrDrawTarget* fDrawTarget; | 322 GrDrawTarget* fDrawTarget; |
324 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; | 323 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; |
325 GrContext* fContext; | 324 GrContext* fContext; |
326 | 325 |
327 SkSurfaceProps fSurfaceProps; | 326 SkSurfaceProps fSurfaceProps; |
328 GrAuditTrail* fAuditTrail; | 327 GrAuditTrail* fAuditTrail; |
329 | 328 |
330 // In debug builds we guard against improper thread handling | 329 // In debug builds we guard against improper thread handling |
331 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 330 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
332 }; | 331 }; |
333 | 332 |
334 #endif | 333 #endif |
OLD | NEW |