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