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 "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
13 #include "SkSurfaceProps.h" | 13 #include "SkSurfaceProps.h" |
14 | 14 |
15 class GrBatch; | |
16 class GrClip; | 15 class GrClip; |
17 class GrContext; | 16 class GrContext; |
| 17 class GrDrawBatch; |
18 class GrDrawTarget; | 18 class GrDrawTarget; |
19 class GrPaint; | 19 class GrPaint; |
20 class GrPathProcessor; | 20 class GrPathProcessor; |
21 class GrPathRange; | 21 class GrPathRange; |
22 class GrPipelineBuilder; | 22 class GrPipelineBuilder; |
23 class GrRenderTarget; | 23 class GrRenderTarget; |
24 class GrStrokeInfo; | 24 class GrStrokeInfo; |
25 class GrSurface; | 25 class GrSurface; |
26 class GrTextContext; | 26 class GrTextContext; |
27 class SkDrawFilter; | 27 class SkDrawFilter; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 const SkRect& oval, | 258 const SkRect& oval, |
259 const GrStrokeInfo& strokeInfo); | 259 const GrStrokeInfo& strokeInfo); |
260 | 260 |
261 | 261 |
262 /** | 262 /** |
263 * Draws a batch | 263 * Draws a batch |
264 * | 264 * |
265 * @param paint describes how to color pixels. | 265 * @param paint describes how to color pixels. |
266 * @param batch the batch to draw | 266 * @param batch the batch to draw |
267 */ | 267 */ |
268 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrBatch*); | 268 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrDrawBatch*)
; |
269 | 269 |
270 private: | 270 private: |
271 friend class GrAtlasTextContext; // for access to drawBatch | 271 friend class GrAtlasTextContext; // for access to drawBatch |
272 friend class GrContext; // for ctor | 272 friend class GrContext; // for ctor |
273 | 273 |
274 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); | 274 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); |
275 | 275 |
276 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); | 276 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); |
277 | 277 |
278 // Checks if the context has been abandoned and if the rendertarget is owned
by this context | 278 // Checks if the context has been abandoned and if the rendertarget is owned
by this context |
279 bool prepareToDraw(GrRenderTarget* rt); | 279 bool prepareToDraw(GrRenderTarget* rt); |
280 | 280 |
281 void internalDrawPath(GrDrawTarget*, | 281 void internalDrawPath(GrDrawTarget*, |
282 GrPipelineBuilder*, | 282 GrPipelineBuilder*, |
283 const SkMatrix& viewMatrix, | 283 const SkMatrix& viewMatrix, |
284 GrColor, | 284 GrColor, |
285 bool useAA, | 285 bool useAA, |
286 const SkPath&, | 286 const SkPath&, |
287 const GrStrokeInfo&); | 287 const GrStrokeInfo&); |
288 | 288 |
289 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 289 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
290 // the drawTarget. | 290 // the drawTarget. |
291 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch); | 291 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
292 | 292 |
293 GrContext* fContext; // owning context -> no ref | 293 GrContext* fContext; // owning context -> no ref |
294 GrDrawTarget* fDrawTarget; | 294 GrDrawTarget* fDrawTarget; |
295 GrTextContext* fTextContext; // lazily created | 295 GrTextContext* fTextContext; // lazily created |
296 | 296 |
297 SkSurfaceProps fSurfaceProps; | 297 SkSurfaceProps fSurfaceProps; |
298 }; | 298 }; |
299 | 299 |
300 #endif | 300 #endif |
OLD | NEW |