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

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

Issue 1914883002: Refactor drawContext/RenderTarget creation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix variable name Created 4 years, 7 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
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('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 2010 Google Inc. 2 * Copyright 2010 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 GrContext_DEFINED 8 #ifndef GrContext_DEFINED
9 #define GrContext_DEFINED 9 #define GrContext_DEFINED
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 * Callers assume the creation ref of the drawContext 187 * Callers assume the creation ref of the drawContext
188 * NULL will be returned if the context has been abandoned. 188 * NULL will be returned if the context has been abandoned.
189 * 189 *
190 * @param rt the render target receiving the draws 190 * @param rt the render target receiving the draws
191 * @param surfaceProps the surface properties (mainly defines text drawing) 191 * @param surfaceProps the surface properties (mainly defines text drawing)
192 * 192 *
193 * @return a draw context 193 * @return a draw context
194 */ 194 */
195 sk_sp<GrDrawContext> drawContext(sk_sp<GrRenderTarget> rt, const SkSurfacePr ops* = nullptr); 195 sk_sp<GrDrawContext> drawContext(sk_sp<GrRenderTarget> rt, const SkSurfacePr ops* = nullptr);
196 196
197 enum BackingFit {
198 kTight_BackingFit,
199 kLoose_BackingFit
200 };
201
202 /**
203 * Create both a GrRenderTarget and a matching GrDrawContext to wrap it.
204 * The created GrRenderTarget will always be budgeted.
205 */
206 sk_sp<GrDrawContext> newDrawContext(BackingFit fit,
207 int width, int height,
208 GrPixelConfig config,
209 int sampleCnt = 0,
210 GrSurfaceOrigin origin = kDefault_GrSurf aceOrigin);
211
197 /////////////////////////////////////////////////////////////////////////// 212 ///////////////////////////////////////////////////////////////////////////
198 // Misc. 213 // Misc.
199 214
200 /** 215 /**
201 * Flags that affect flush() behavior. 216 * Flags that affect flush() behavior.
202 */ 217 */
203 enum FlushBits { 218 enum FlushBits {
204 /** 219 /**
205 * A client may reach a point where it has partially rendered a frame 220 * A client may reach a point where it has partially rendered a frame
206 * through a GrContext that it knows the user will never see. This flag 221 * through a GrContext that it knows the user will never see. This flag
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 SkAutoTUnref<const GrCaps> fCaps; 493 SkAutoTUnref<const GrCaps> fCaps;
479 uint32_t fContextUniqueID; 494 uint32_t fContextUniqueID;
480 495
481 friend class GrContext; 496 friend class GrContext;
482 friend class SkImage; 497 friend class SkImage;
483 498
484 typedef SkRefCnt INHERITED; 499 typedef SkRefCnt INHERITED;
485 }; 500 };
486 501
487 #endif 502 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698