Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: include/gpu/GrDrawContext.h

Issue 1375153007: Dynamically allocate the GrDrawContexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix more bugs Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 * 256 *
257 * @param paint describes how to color pixels. 257 * @param paint describes how to color pixels.
258 * @param batch the batch to draw 258 * @param batch the batch to draw
259 */ 259 */
260 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrDrawBatch*) ; 260 void drawBatch(GrRenderTarget*, const GrClip&, const GrPaint&, GrDrawBatch*) ;
261 261
262 private: 262 private:
263 friend class GrAtlasTextContext; // for access to drawBatch 263 friend class GrAtlasTextContext; // for access to drawBatch
264 friend class GrContext; // for ctor 264 friend class GrContext; // for ctor
265 265
266 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps&); 266 GrDrawContext(GrContext*, GrDrawTarget*, const SkSurfaceProps* surfaceProps) ;
267
268 GrTextContext* createTextContext(GrRenderTarget*, const SkSurfaceProps&);
269 267
270 // Checks if the context has been abandoned and if the rendertarget is owned by this context 268 // Checks if the context has been abandoned and if the rendertarget is owned by this context
271 bool prepareToDraw(GrRenderTarget* rt); 269 bool prepareToDraw(GrRenderTarget* rt);
272 270
273 void internalDrawPath(GrDrawTarget*, 271 void internalDrawPath(GrDrawTarget*,
274 GrPipelineBuilder*, 272 GrPipelineBuilder*,
275 const SkMatrix& viewMatrix, 273 const SkMatrix& viewMatrix,
276 GrColor, 274 GrColor,
277 bool useAA, 275 bool useAA,
278 const SkPath&, 276 const SkPath&,
279 const GrStrokeInfo&); 277 const GrStrokeInfo&);
280 278
281 // This entry point allows the GrTextContext-derived classes to add their ba tches to 279 // This entry point allows the GrTextContext-derived classes to add their ba tches to
282 // the drawTarget. 280 // the drawTarget.
283 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch); 281 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch);
284 282
285 GrContext* fContext; // owning context -> no ref 283 GrContext* fContext; // owning context -> no ref
286 GrDrawTarget* fDrawTarget; 284 GrDrawTarget* fDrawTarget;
287 GrTextContext* fTextContext; // lazily created 285 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMg r
288 286
289 SkSurfaceProps fSurfaceProps; 287 SkSurfaceProps fSurfaceProps;
290 }; 288 };
291 289
292 #endif 290 #endif
OLDNEW
« include/gpu/GrContext.h ('K') | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698