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 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "GrRenderTarget.h" | 12 #include "GrRenderTarget.h" |
13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
14 #include "SkSurfaceProps.h" | 14 #include "SkSurfaceProps.h" |
15 #include "../private/GrSingleOwner.h" | 15 #include "../private/GrSingleOwner.h" |
16 | 16 |
| 17 class GrAuditTrail; |
17 class GrClip; | 18 class GrClip; |
18 class GrContext; | 19 class GrContext; |
19 class GrDrawBatch; | 20 class GrDrawBatch; |
20 class GrDrawPathBatchBase; | 21 class GrDrawPathBatchBase; |
21 class GrDrawingManager; | 22 class GrDrawingManager; |
22 class GrDrawTarget; | 23 class GrDrawTarget; |
23 class GrPaint; | 24 class GrPaint; |
24 class GrPathProcessor; | 25 class GrPathProcessor; |
25 class GrPipelineBuilder; | 26 class GrPipelineBuilder; |
26 class GrRenderTarget; | 27 class GrRenderTarget; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 278 |
278 GrRenderTarget* accessRenderTarget() { return fRenderTarget; } | 279 GrRenderTarget* accessRenderTarget() { return fRenderTarget; } |
279 | 280 |
280 private: | 281 private: |
281 friend class GrAtlasTextBlob; // for access to drawBatch | 282 friend class GrAtlasTextBlob; // for access to drawBatch |
282 friend class GrDrawingManager; // for ctor | 283 friend class GrDrawingManager; // for ctor |
283 | 284 |
284 SkDEBUGCODE(void validate() const;) | 285 SkDEBUGCODE(void validate() const;) |
285 | 286 |
286 GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surf
aceProps, | 287 GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surf
aceProps, |
287 GrSingleOwner*); | 288 GrAuditTrail*, GrSingleOwner*); |
288 | 289 |
289 void internalDrawPath(GrPipelineBuilder*, | 290 void internalDrawPath(GrPipelineBuilder*, |
290 const SkMatrix& viewMatrix, | 291 const SkMatrix& viewMatrix, |
291 GrColor, | 292 GrColor, |
292 bool useAA, | 293 bool useAA, |
293 const SkPath&, | 294 const SkPath&, |
294 const GrStrokeInfo&); | 295 const GrStrokeInfo&); |
295 | 296 |
296 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 297 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
297 // the drawTarget. | 298 // the drawTarget. |
298 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 299 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
299 | 300 |
300 GrDrawTarget* getDrawTarget(); | 301 GrDrawTarget* getDrawTarget(); |
301 | 302 |
302 GrDrawingManager* fDrawingManager; | 303 GrDrawingManager* fDrawingManager; |
303 GrRenderTarget* fRenderTarget; | 304 GrRenderTarget* fRenderTarget; |
304 | 305 |
305 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 306 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
306 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 307 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
307 GrDrawTarget* fDrawTarget; | 308 GrDrawTarget* fDrawTarget; |
308 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger | 309 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger |
309 | 310 |
310 SkSurfaceProps fSurfaceProps; | 311 SkSurfaceProps fSurfaceProps; |
| 312 GrAuditTrail* fAuditTrail; |
311 | 313 |
312 // In debug builds we guard against improper thread handling | 314 // In debug builds we guard against improper thread handling |
313 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 315 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
314 }; | 316 }; |
315 | 317 |
316 #endif | 318 #endif |
OLD | NEW |