| OLD | NEW |
| 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 Loading... |
| 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 |
| 197 /** | 202 /** |
| 198 * Create both a GrRenderTarget and a matching GrDrawContext to wrap it. | 203 * Create both a GrRenderTarget and a matching GrDrawContext to wrap it. |
| 199 * The created GrRenderTarget will always be budgeted. | 204 * The created GrRenderTarget will always be budgeted. |
| 200 */ | 205 */ |
| 201 sk_sp<GrDrawContext> newDrawContext(SkBackingFit fit, | 206 sk_sp<GrDrawContext> newDrawContext(BackingFit fit, |
| 202 int width, int height, | 207 int width, int height, |
| 203 GrPixelConfig config, | 208 GrPixelConfig config, |
| 204 int sampleCnt = 0, | 209 int sampleCnt = 0, |
| 205 GrSurfaceOrigin origin = kDefault_GrSurf
aceOrigin); | 210 GrSurfaceOrigin origin = kDefault_GrSurf
aceOrigin); |
| 206 | 211 |
| 207 /////////////////////////////////////////////////////////////////////////// | 212 /////////////////////////////////////////////////////////////////////////// |
| 208 // Misc. | 213 // Misc. |
| 209 | 214 |
| 210 /** | 215 /** |
| 211 * Flags that affect flush() behavior. | 216 * Flags that affect flush() behavior. |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 SkAutoTUnref<const GrCaps> fCaps; | 493 SkAutoTUnref<const GrCaps> fCaps; |
| 489 uint32_t fContextUniqueID; | 494 uint32_t fContextUniqueID; |
| 490 | 495 |
| 491 friend class GrContext; | 496 friend class GrContext; |
| 492 friend class SkImage; | 497 friend class SkImage; |
| 493 | 498 |
| 494 typedef SkRefCnt INHERITED; | 499 typedef SkRefCnt INHERITED; |
| 495 }; | 500 }; |
| 496 | 501 |
| 497 #endif | 502 #endif |
| OLD | NEW |