| 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*); |
| 287 | 288 |
| 288 void internalDrawPath(GrPipelineBuilder*, | 289 void internalDrawPath(GrPipelineBuilder*, |
| 289 const SkMatrix& viewMatrix, | 290 const SkMatrix& viewMatrix, |
| 290 GrColor, | 291 GrColor, |
| 291 bool useAA, | 292 bool useAA, |
| 292 const SkPath&, | 293 const SkPath&, |
| 293 const GrStrokeInfo&); | 294 const GrStrokeInfo&); |
| 294 | 295 |
| 295 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 296 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
| 296 // the drawTarget. | 297 // the drawTarget. |
| 297 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 298 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
| 298 | 299 |
| 299 GrDrawTarget* getDrawTarget(); | 300 GrDrawTarget* getDrawTarget(); |
| 300 | 301 |
| 301 GrDrawingManager* fDrawingManager; | 302 GrDrawingManager* fDrawingManager; |
| 302 GrRenderTarget* fRenderTarget; | 303 GrRenderTarget* fRenderTarget; |
| 303 | 304 |
| 304 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 305 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
| 305 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 306 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
| 306 GrDrawTarget* fDrawTarget; | 307 GrDrawTarget* fDrawTarget; |
| 307 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger | 308 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana
ger |
| 308 | 309 |
| 309 SkSurfaceProps fSurfaceProps; | 310 SkSurfaceProps fSurfaceProps; |
| 310 | 311 |
| 311 // In debug builds we guard against improper thread handling | 312 // In debug builds we guard against improper thread handling |
| 312 SkDEBUGCODE(mutable GrSingleOwner fSingleOwner;) | 313 mutable GrSingleOwner* fSingleOwner; |
| 313 }; | 314 }; |
| 314 | 315 |
| 315 #endif | 316 #endif |
| OLD | NEW |