| 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 GrClip; | 15 class GrClip; |
| 16 class GrContext; | 16 class GrContext; |
| 17 class GrDraw; |
| 17 class GrDrawBatch; | 18 class GrDrawBatch; |
| 18 class GrDrawTarget; | 19 class GrDrawTarget; |
| 19 class GrPaint; | 20 class GrPaint; |
| 20 class GrPathProcessor; | 21 class GrPathProcessor; |
| 21 class GrPathRangeDraw; | 22 class GrPathRangeDraw; |
| 22 class GrPipelineBuilder; | 23 class GrPipelineBuilder; |
| 23 class GrRenderTarget; | 24 class GrRenderTarget; |
| 24 class GrStrokeInfo; | 25 class GrStrokeInfo; |
| 25 class GrSurface; | 26 class GrSurface; |
| 26 class GrTextContext; | 27 class GrTextContext; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 253 |
| 253 | 254 |
| 254 /** | 255 /** |
| 255 * Draws a batch | 256 * Draws a batch |
| 256 * | 257 * |
| 257 * @param paint describes how to color pixels. | 258 * @param paint describes how to color pixels. |
| 258 * @param batch the batch to draw | 259 * @param batch the batch to draw |
| 259 */ | 260 */ |
| 260 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrDrawBatch*)
; | 261 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrDrawBatch*)
; |
| 261 | 262 |
| 263 /** |
| 264 * Experimental draw interface |
| 265 */ |
| 266 void draw(const GrDraw&); |
| 267 |
| 262 private: | 268 private: |
| 263 friend class GrAtlasTextContext; // for access to drawBatch | 269 friend class GrAtlasTextContext; // for access to drawBatch |
| 264 friend class GrContext; // for ctor | 270 friend class GrContext; // for ctor |
| 265 | 271 |
| 266 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); | 272 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); |
| 267 | 273 |
| 268 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); | 274 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); |
| 269 | 275 |
| 270 // Checks if the context has been abandoned and if the rendertarget is owned
by this context | 276 // Checks if the context has been abandoned and if the rendertarget is owned
by this context |
| 271 bool prepareToDraw(GrRenderTarget* rt); | 277 bool prepareToDraw(GrRenderTarget* rt); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 283 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); | 289 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); |
| 284 | 290 |
| 285 GrContext* fContext; // owning context -> no ref | 291 GrContext* fContext; // owning context -> no ref |
| 286 GrDrawTarget* fDrawTarget; | 292 GrDrawTarget* fDrawTarget; |
| 287 GrTextContext* fTextContext; // lazily created | 293 GrTextContext* fTextContext; // lazily created |
| 288 | 294 |
| 289 SkSurfaceProps fSurfaceProps; | 295 SkSurfaceProps fSurfaceProps; |
| 290 }; | 296 }; |
| 291 | 297 |
| 292 #endif | 298 #endif |
| OLD | NEW |