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

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

Issue 1494083003: Reduce calls sites where both the GrDrawContext & GrRenderTarget are both passed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 * 271 *
272 * @param paint describes how to color pixels. 272 * @param paint describes how to color pixels.
273 * @param batch the batch to draw 273 * @param batch the batch to draw
274 */ 274 */
275 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); 275 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*);
276 276
277 int width() const { return fRenderTarget->width(); } 277 int width() const { return fRenderTarget->width(); }
278 int height() const { return fRenderTarget->height(); } 278 int height() const { return fRenderTarget->height(); }
279 int numColorSamples() const { return fRenderTarget->numColorSamples(); } 279 int numColorSamples() const { return fRenderTarget->numColorSamples(); }
280 280
281 GrRenderTarget* accessRenderTarget() { return fRenderTarget; }
282
281 private: 283 private:
282 friend class GrAtlasTextContext; // for access to drawBatch 284 friend class GrAtlasTextContext; // for access to drawBatch
283 friend class GrDrawingManager; // for ctor 285 friend class GrDrawingManager; // for ctor
284 286
285 SkDEBUGCODE(void validate() const;) 287 SkDEBUGCODE(void validate() const;)
286 288
287 GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surf aceProps); 289 GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surf aceProps);
288 290
289 void internalDrawPath(GrPipelineBuilder*, 291 void internalDrawPath(GrPipelineBuilder*,
290 const SkMatrix& viewMatrix, 292 const SkMatrix& viewMatrix,
(...skipping 13 matching lines...) Expand all
304 306
305 // In MDB-mode the drawTarget can be closed by some other drawContext that h as picked 307 // In MDB-mode the drawTarget can be closed by some other drawContext that h as picked
306 // it up. For this reason, the drawTarget should only ever be accessed via ' getDrawTarget'. 308 // it up. For this reason, the drawTarget should only ever be accessed via ' getDrawTarget'.
307 GrDrawTarget* fDrawTarget; 309 GrDrawTarget* fDrawTarget;
308 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana ger 310 GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMana ger
309 311
310 SkSurfaceProps fSurfaceProps; 312 SkSurfaceProps fSurfaceProps;
311 }; 313 };
312 314
313 #endif 315 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698