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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 * @param batch the batch to draw | 249 * @param batch the batch to draw |
250 */ | 250 */ |
251 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); | 251 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); |
252 | 252 |
253 private: | 253 private: |
254 friend class GrAtlasTextContext; // for access to drawBatch | 254 friend class GrAtlasTextContext; // for access to drawBatch |
255 friend class GrContext; // for ctor | 255 friend class GrContext; // for ctor |
256 | 256 |
257 SkDEBUGCODE(void validate() const;) | 257 SkDEBUGCODE(void validate() const;) |
258 | 258 |
259 GrDrawContext(GrContext*, GrRenderTarget*, GrDrawTarget*, const SkSurfacePro
ps* surfaceProps); | 259 GrDrawContext(GrContext*, GrRenderTarget*, const SkSurfaceProps* surfaceProp
s); |
260 | 260 |
261 void internalDrawPath(GrDrawTarget*, | 261 void internalDrawPath(GrDrawTarget*, |
262 GrPipelineBuilder*, | 262 GrPipelineBuilder*, |
263 const SkMatrix& viewMatrix, | 263 const SkMatrix& viewMatrix, |
264 GrColor, | 264 GrColor, |
265 bool useAA, | 265 bool useAA, |
266 const SkPath&, | 266 const SkPath&, |
267 const GrStrokeInfo&); | 267 const GrStrokeInfo&); |
268 | 268 |
269 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 269 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
270 // the drawTarget. | 270 // the drawTarget. |
271 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 271 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
272 | 272 |
| 273 GrDrawTarget* getDrawTarget(); |
| 274 |
273 GrContext* fContext; // owning context -> no ref | 275 GrContext* fContext; // owning context -> no ref |
274 GrRenderTarget* fRenderTarget; | 276 GrRenderTarget* fRenderTarget; |
| 277 |
| 278 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
| 279 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
275 GrDrawTarget* fDrawTarget; | 280 GrDrawTarget* fDrawTarget; |
276 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMg
r | 281 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMg
r |
277 | 282 |
278 SkSurfaceProps fSurfaceProps; | 283 SkSurfaceProps fSurfaceProps; |
279 }; | 284 }; |
280 | 285 |
281 #endif | 286 #endif |
OLD | NEW |