| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 const SkRect& oval, | 237 const SkRect& oval, |
| 238 const GrStrokeInfo& strokeInfo); | 238 const GrStrokeInfo& strokeInfo); |
| 239 | 239 |
| 240 | 240 |
| 241 private: | 241 private: |
| 242 friend class GrAtlasTextContext; // for access to drawBatch | 242 friend class GrAtlasTextContext; // for access to drawBatch |
| 243 friend class GrContext; // for ctor | 243 friend class GrContext; // for ctor |
| 244 | 244 |
| 245 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); | 245 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); |
| 246 | 246 |
| 247 // Sets the paint. Returns true on success; false on failure. | |
| 248 bool prepareToDraw(GrPipelineBuilder*, | |
| 249 GrRenderTarget* rt, | |
| 250 const GrClip&, | |
| 251 const GrPaint* paint); | |
| 252 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); | 247 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&); |
| 253 | 248 |
| 254 // A simpler version of the above which just returns true on success; false
on failure. | 249 // Checks if the context has been abandoned and if the rendertarget is owned
by this context |
| 255 // Clip is *NOT* set | |
| 256 bool prepareToDraw(GrRenderTarget* rt); | 250 bool prepareToDraw(GrRenderTarget* rt); |
| 257 | 251 |
| 258 void internalDrawPath(GrDrawTarget*, | 252 void internalDrawPath(GrDrawTarget*, |
| 259 GrPipelineBuilder*, | 253 GrPipelineBuilder*, |
| 260 const SkMatrix& viewMatrix, | 254 const SkMatrix& viewMatrix, |
| 261 GrColor, | 255 GrColor, |
| 262 bool useAA, | 256 bool useAA, |
| 263 const SkPath&, | 257 const SkPath&, |
| 264 const GrStrokeInfo&); | 258 const GrStrokeInfo&); |
| 265 | 259 |
| 266 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 260 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
| 267 // the drawTarget. | 261 // the drawTarget. |
| 268 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch); | 262 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch); |
| 269 | 263 |
| 270 GrContext* fContext; // owning context -> no ref | 264 GrContext* fContext; // owning context -> no ref |
| 271 GrDrawTarget* fDrawTarget; | 265 GrDrawTarget* fDrawTarget; |
| 272 GrTextContext* fTextContext; // lazily created | 266 GrTextContext* fTextContext; // lazily created |
| 273 | 267 |
| 274 SkSurfaceProps fSurfaceProps; | 268 SkSurfaceProps fSurfaceProps; |
| 275 }; | 269 }; |
| 276 | 270 |
| 277 #endif | 271 #endif |
| OLD | NEW |