blob: 58eb8c59a4927b0e5a244be0a7bf5f7656cce5b3 [file] [log] [blame]
Robert Phillips4217ea72019-01-30 13:08:28 -05001/*
2 * Copyright 2019 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "include/private/GrRecordingContext.h"
Robert Phillips4217ea72019-01-30 13:08:28 -05009
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "include/gpu/GrContext.h"
Robert Phillips61fc7992019-10-22 11:58:17 -040011#include "src/core/SkArenaAlloc.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040012#include "src/gpu/GrAuditTrail.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050013#include "src/gpu/GrCaps.h"
14#include "src/gpu/GrDrawingManager.h"
15#include "src/gpu/GrMemoryPool.h"
16#include "src/gpu/GrProxyProvider.h"
17#include "src/gpu/GrRecordingContextPriv.h"
18#include "src/gpu/GrRenderTargetContext.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040019#include "src/gpu/GrSkSLFPFactoryCache.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050020#include "src/gpu/GrTextureContext.h"
21#include "src/gpu/SkGr.h"
22#include "src/gpu/text/GrTextBlobCache.h"
Robert Phillipsa41c6852019-02-07 10:44:10 -050023
Robert Phillips292a6b22019-02-14 14:49:02 -050024#define ASSERT_SINGLE_OWNER_PRIV \
25 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());)
26
Robert Phillipsc1541ae2019-02-04 12:05:37 -050027GrRecordingContext::GrRecordingContext(GrBackendApi backend,
28 const GrContextOptions& options,
Robert Phillipsa41c6852019-02-07 10:44:10 -050029 uint32_t contextID)
Greg Danielf91aeb22019-06-18 09:58:02 -040030 : INHERITED(backend, options, contextID)
31 , fAuditTrail(new GrAuditTrail()) {
Robert Phillips4217ea72019-01-30 13:08:28 -050032}
33
34GrRecordingContext::~GrRecordingContext() { }
35
Robert Phillips2184fb72019-02-21 16:11:41 -050036/**
37 * TODO: move textblob draw calls below context (see comment below)
38 */
39static void textblobcache_overbudget_CB(void* data) {
40 SkASSERT(data);
41 GrRecordingContext* context = reinterpret_cast<GrRecordingContext*>(data);
42
43 GrContext* direct = context->priv().asDirectContext();
44 if (!direct) {
45 return;
46 }
47
48 // TextBlobs are drawn at the SkGpuDevice level, therefore they cannot rely on
49 // GrRenderTargetContext to perform a necessary flush. The solution is to move drawText calls
50 // to below the GrContext level, but this is not trivial because they call drawPath on
51 // SkGpuDevice.
52 direct->flush();
53}
54
Robert Phillips292a6b22019-02-14 14:49:02 -050055bool GrRecordingContext::init(sk_sp<const GrCaps> caps, sk_sp<GrSkSLFPFactoryCache> cache) {
56
57 if (!INHERITED::init(std::move(caps), std::move(cache))) {
58 return false;
59 }
60
Herb Derbya00da612019-03-04 17:10:01 -050061 fStrikeCache.reset(new GrStrikeCache(this->caps(),
Robert Phillips2184fb72019-02-21 16:11:41 -050062 this->options().fGlyphCacheTextureMaximumBytes));
63
64 fTextBlobCache.reset(new GrTextBlobCache(textblobcache_overbudget_CB, this,
65 this->contextID()));
66
Robert Phillips56181ba2019-03-08 12:00:45 -050067 return true;
68}
69
Greg Danielf41b2bd2019-08-22 16:19:24 -040070void GrRecordingContext::setupDrawingManager(bool sortOpsTasks, bool reduceOpsTaskSplitting) {
Robert Phillips69893702019-02-22 11:16:30 -050071 GrPathRendererChain::Options prcOptions;
72 prcOptions.fAllowPathMaskCaching = this->options().fAllowPathMaskCaching;
73#if GR_TEST_UTILS
74 prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
75#endif
Chris Daltonf7748182019-03-18 16:22:30 +000076 // FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
77 if (!this->options().fDisableCoverageCountingPaths) {
78 prcOptions.fGpuPathRenderers |= GpuPathRenderers::kCoverageCounting;
Robert Phillips69893702019-02-22 11:16:30 -050079 }
80 if (this->options().fDisableDistanceFieldPaths) {
81 prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
82 }
83
84 if (!this->proxyProvider()->renderingDirectly()) {
85 // DDL TODO: remove this crippling of the path renderer chain
86 // Disable the small path renderer bc of the proxies in the atlas. They need to be
Greg Danielf41b2bd2019-08-22 16:19:24 -040087 // unified when the opsTasks are added back to the destination drawing manager.
Robert Phillips69893702019-02-22 11:16:30 -050088 prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
89 }
90
91 GrTextContext::Options textContextOptions;
92 textContextOptions.fMaxDistanceFieldFontSize = this->options().fGlyphsAsPathsFontSize;
93 textContextOptions.fMinDistanceFieldFontSize = this->options().fMinDistanceFieldFontSize;
94 textContextOptions.fDistanceFieldVerticesAlwaysHaveW = false;
95#if SK_SUPPORT_ATLAS_TEXT
96 if (GrContextOptions::Enable::kYes == this->options().fDistanceFieldGlyphVerticesAlwaysHaveW) {
97 textContextOptions.fDistanceFieldVerticesAlwaysHaveW = true;
98 }
99#endif
100
101 fDrawingManager.reset(new GrDrawingManager(this,
Robert Phillips12c46292019-04-23 07:36:17 -0400102 prcOptions,
103 textContextOptions,
Greg Danielf41b2bd2019-08-22 16:19:24 -0400104 sortOpsTasks,
105 reduceOpsTaskSplitting));
Robert Phillips292a6b22019-02-14 14:49:02 -0500106}
107
Robert Phillipsa9162df2019-02-11 14:12:03 -0500108void GrRecordingContext::abandonContext() {
109 INHERITED::abandonContext();
Robert Phillips2184fb72019-02-21 16:11:41 -0500110
Herb Derbya00da612019-03-04 17:10:01 -0500111 fStrikeCache->freeAll();
Robert Phillips2184fb72019-02-21 16:11:41 -0500112 fTextBlobCache->freeAll();
Robert Phillipsa9162df2019-02-11 14:12:03 -0500113}
114
Robert Phillips69893702019-02-22 11:16:30 -0500115GrDrawingManager* GrRecordingContext::drawingManager() {
116 return fDrawingManager.get();
117}
118
Robert Phillips61fc7992019-10-22 11:58:17 -0400119// This entry point exists bc the GrOpsTask (and SkAtlasTextTarget) take refs on the memory pool.
120// Ostensibly, this is to keep the op's data alive in DDL mode but the back pointer is also
121// used for deletion.
Robert Phillipsd6841482019-02-08 10:29:20 -0500122sk_sp<GrOpMemoryPool> GrRecordingContext::refOpMemoryPool() {
123 if (!fOpMemoryPool) {
124 // DDL TODO: should the size of the memory pool be decreased in DDL mode? CPU-side memory
125 // consumed in DDL mode vs. normal mode for a single skp might be a good metric of wasted
126 // memory.
127 fOpMemoryPool = sk_sp<GrOpMemoryPool>(new GrOpMemoryPool(16384, 16384));
128 }
129
130 SkASSERT(fOpMemoryPool);
131 return fOpMemoryPool;
132}
133
134GrOpMemoryPool* GrRecordingContext::opMemoryPool() {
135 return this->refOpMemoryPool().get();
136}
137
Robert Phillips61fc7992019-10-22 11:58:17 -0400138// Stored in this arena:
139// GrTextureOp's DynamicStateArrays and FixedDynamicState
140SkArenaAlloc* GrRecordingContext::opPODAllocator() {
141 if (!fOpPODAllocator) {
142 // TODO: empirically determine a better number for SkArenaAlloc's firstHeapAllocation param
143 fOpPODAllocator = std::unique_ptr<SkArenaAlloc>(new SkArenaAlloc(sizeof(GrPipeline) * 100));
144 }
145
146 SkASSERT(fOpPODAllocator);
147 return fOpPODAllocator.get();
148}
149
150std::unique_ptr<SkArenaAlloc> GrRecordingContext::detachOpPOD() {
151 return std::move(fOpPODAllocator);
152}
153
Robert Phillips2184fb72019-02-21 16:11:41 -0500154GrTextBlobCache* GrRecordingContext::getTextBlobCache() {
155 return fTextBlobCache.get();
156}
157
158const GrTextBlobCache* GrRecordingContext::getTextBlobCache() const {
159 return fTextBlobCache.get();
160}
161
Robert Phillipsc5058a62019-02-15 12:52:59 -0500162void GrRecordingContext::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
163 this->drawingManager()->addOnFlushCallbackObject(onFlushCBObject);
164}
165
Brian Salomonbf6b9792019-08-21 09:38:10 -0400166std::unique_ptr<GrSurfaceContext> GrRecordingContext::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400167 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400168 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400169 SkAlphaType alphaType,
170 sk_sp<SkColorSpace> colorSpace,
171 const SkSurfaceProps* props) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500172 ASSERT_SINGLE_OWNER_PRIV
173
Brian Salomon9d8cac82019-07-16 15:59:31 -0400174 SkASSERT(proxy);
175
Robert Phillips292a6b22019-02-14 14:49:02 -0500176 if (proxy->asRenderTargetProxy()) {
Brian Salomone7499c72019-06-24 12:12:36 -0400177 SkASSERT(kPremul_SkAlphaType == alphaType || kOpaque_SkAlphaType == alphaType);
Brian Salomond6287472019-06-24 15:50:07 -0400178 return this->drawingManager()->makeRenderTargetContext(std::move(proxy), colorType,
Robert Phillips292a6b22019-02-14 14:49:02 -0500179 std::move(colorSpace), props);
180 } else {
181 SkASSERT(proxy->asTextureProxy());
182 SkASSERT(!props);
Brian Salomond6287472019-06-24 15:50:07 -0400183 return this->drawingManager()->makeTextureContext(std::move(proxy), colorType, alphaType,
Brian Salomone7499c72019-06-24 12:12:36 -0400184 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500185 }
186}
187
Brian Salomonbf6b9792019-08-21 09:38:10 -0400188std::unique_ptr<GrTextureContext> GrRecordingContext::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400189 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400190 int width,
191 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400192 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400193 SkAlphaType alphaType,
194 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400195 GrMipMapped mipMapped,
196 GrSurfaceOrigin origin,
197 SkBudgeted budgeted,
198 GrProtected isProtected) {
Robert Phillips0a15cc62019-07-30 12:49:10 -0400199 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kNo);
Brian Salomon947efe22019-07-16 15:36:11 -0400200 if (!format.isValid()) {
201 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500202 }
Brian Salomon947efe22019-07-16 15:36:11 -0400203 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
204 if (config == kUnknown_GrPixelConfig) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500205 return nullptr;
206 }
207
Brian Salomon947efe22019-07-16 15:36:11 -0400208 GrSurfaceDesc desc;
209 desc.fWidth = width;
210 desc.fHeight = height;
Brian Salomon947efe22019-07-16 15:36:11 -0400211 desc.fConfig = config;
212
Brian Salomonbeb7f522019-08-30 16:19:42 -0400213 sk_sp<GrTextureProxy> texture = this->proxyProvider()->createProxy(
214 format, desc, GrRenderable::kNo, 1, origin, mipMapped, fit, budgeted, isProtected);
Brian Salomon947efe22019-07-16 15:36:11 -0400215 if (!texture) {
216 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500217 }
218
Brian Salomon947efe22019-07-16 15:36:11 -0400219 auto drawingManager = this->drawingManager();
220
221 return drawingManager->makeTextureContext(std::move(texture), colorType, alphaType,
222 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500223}
224
Brian Salomonbf6b9792019-08-21 09:38:10 -0400225std::unique_ptr<GrRenderTargetContext> GrRecordingContext::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400226 SkBackingFit fit,
227 int width,
228 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400229 GrColorType colorType,
230 sk_sp<SkColorSpace> colorSpace,
231 int sampleCnt,
232 GrMipMapped mipMapped,
233 GrSurfaceOrigin origin,
234 const SkSurfaceProps* surfaceProps,
235 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400236 GrProtected isProtected) {
Robert Phillipsb97da532019-02-12 15:24:12 -0500237 SkASSERT(sampleCnt > 0);
238 if (this->abandoned()) {
239 return nullptr;
240 }
241
Robert Phillips0a15cc62019-07-30 12:49:10 -0400242 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kYes);
Brian Salomon27ae52c2019-07-03 11:27:44 -0400243 if (!format.isValid()) {
244 return nullptr;
245 }
246 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
247 if (config == kUnknown_GrPixelConfig) {
248 return nullptr;
249 }
250
Robert Phillipsb97da532019-02-12 15:24:12 -0500251 GrSurfaceDesc desc;
Robert Phillipsb97da532019-02-12 15:24:12 -0500252 desc.fWidth = width;
253 desc.fHeight = height;
254 desc.fConfig = config;
Robert Phillipsb97da532019-02-12 15:24:12 -0500255
Brian Salomonbeb7f522019-08-30 16:19:42 -0400256 sk_sp<GrTextureProxy> rtp =
257 this->proxyProvider()->createProxy(format, desc, GrRenderable::kYes, sampleCnt, origin,
258 mipMapped, fit, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500259 if (!rtp) {
260 return nullptr;
261 }
262
Robert Phillipsb97da532019-02-12 15:24:12 -0500263 auto drawingManager = this->drawingManager();
264
Brian Salomonbf6b9792019-08-21 09:38:10 -0400265 auto renderTargetContext = drawingManager->makeRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400266 std::move(rtp), colorType, std::move(colorSpace), surfaceProps);
Robert Phillipsb97da532019-02-12 15:24:12 -0500267 if (!renderTargetContext) {
268 return nullptr;
269 }
270
271 renderTargetContext->discard();
272
273 return renderTargetContext;
274}
Robert Phillipsd6841482019-02-08 10:29:20 -0500275
Brian Salomon27ae52c2019-07-03 11:27:44 -0400276static inline GrColorType color_type_fallback(GrColorType ct) {
277 switch (ct) {
278 // kRGBA_8888 is our default fallback for many color types that may not have renderable
279 // backend formats.
Brian Salomond6287472019-06-24 15:50:07 -0400280 case GrColorType::kAlpha_8:
Brian Salomond6287472019-06-24 15:50:07 -0400281 case GrColorType::kBGR_565:
Brian Salomond6287472019-06-24 15:50:07 -0400282 case GrColorType::kABGR_4444:
Brian Salomond6287472019-06-24 15:50:07 -0400283 case GrColorType::kBGRA_8888:
Brian Salomond6287472019-06-24 15:50:07 -0400284 case GrColorType::kRGBA_1010102:
Brian Salomond6287472019-06-24 15:50:07 -0400285 case GrColorType::kRGBA_F16:
Brian Salomond6287472019-06-24 15:50:07 -0400286 case GrColorType::kRGBA_F16_Clamped:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400287 return GrColorType::kRGBA_8888;
Brian Salomond6287472019-06-24 15:50:07 -0400288 case GrColorType::kAlpha_F16:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400289 return GrColorType::kRGBA_F16;
Brian Salomond6287472019-06-24 15:50:07 -0400290 case GrColorType::kGray_8:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400291 return GrColorType::kRGB_888x;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500292 default:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400293 return GrColorType::kUnknown;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500294 }
295}
296
Brian Salomonbf6b9792019-08-21 09:38:10 -0400297std::unique_ptr<GrRenderTargetContext>
298GrRecordingContext::makeDeferredRenderTargetContextWithFallback(SkBackingFit fit,
299 int width,
300 int height,
301 GrColorType colorType,
302 sk_sp<SkColorSpace> colorSpace,
303 int sampleCnt,
304 GrMipMapped mipMapped,
305 GrSurfaceOrigin origin,
306 const SkSurfaceProps* surfaceProps,
307 SkBudgeted budgeted,
308 GrProtected isProtected) {
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500309 SkASSERT(sampleCnt > 0);
Brian Salomonbf6b9792019-08-21 09:38:10 -0400310 std::unique_ptr<GrRenderTargetContext> rtc;
Brian Salomon27ae52c2019-07-03 11:27:44 -0400311 do {
312 rtc = this->makeDeferredRenderTargetContext(fit, width, height, colorType, colorSpace,
313 sampleCnt, mipMapped, origin, surfaceProps,
314 budgeted, isProtected);
315 colorType = color_type_fallback(colorType);
316 } while (!rtc && colorType != GrColorType::kUnknown);
317 return rtc;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500318}
319
Robert Phillipsa41c6852019-02-07 10:44:10 -0500320///////////////////////////////////////////////////////////////////////////////////////////////////
321sk_sp<const GrCaps> GrRecordingContextPriv::refCaps() const {
322 return fContext->refCaps();
323}
324
Robert Phillips61fc7992019-10-22 11:58:17 -0400325std::unique_ptr<SkArenaAlloc> GrRecordingContextPriv::detachOpPOD() {
326 return fContext->detachOpPOD();
327}
328
Robert Phillipsa41c6852019-02-07 10:44:10 -0500329sk_sp<GrSkSLFPFactoryCache> GrRecordingContextPriv::fpFactoryCache() {
330 return fContext->fpFactoryCache();
331}
Robert Phillipsd6841482019-02-08 10:29:20 -0500332
333sk_sp<GrOpMemoryPool> GrRecordingContextPriv::refOpMemoryPool() {
334 return fContext->refOpMemoryPool();
335}
Robert Phillipsb97da532019-02-12 15:24:12 -0500336
Robert Phillipsc5058a62019-02-15 12:52:59 -0500337void GrRecordingContextPriv::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
338 fContext->addOnFlushCallbackObject(onFlushCBObject);
339}
340
Brian Salomonbf6b9792019-08-21 09:38:10 -0400341std::unique_ptr<GrSurfaceContext> GrRecordingContextPriv::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400342 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400343 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400344 SkAlphaType alphaType,
345 sk_sp<SkColorSpace> colorSpace,
346 const SkSurfaceProps* props) {
Brian Salomond6287472019-06-24 15:50:07 -0400347 return fContext->makeWrappedSurfaceContext(std::move(proxy), colorType, alphaType,
348 std::move(colorSpace), props);
Robert Phillips292a6b22019-02-14 14:49:02 -0500349}
350
Brian Salomonbf6b9792019-08-21 09:38:10 -0400351std::unique_ptr<GrTextureContext> GrRecordingContextPriv::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400352 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400353 int width,
354 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400355 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400356 SkAlphaType alphaType,
357 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400358 GrMipMapped mipMapped,
359 GrSurfaceOrigin origin,
360 SkBudgeted budgeted,
361 GrProtected isProtected) {
362 return fContext->makeDeferredTextureContext(fit, width, height, colorType, alphaType,
363 std::move(colorSpace), mipMapped, origin, budgeted,
364 isProtected);
Robert Phillips292a6b22019-02-14 14:49:02 -0500365}
366
Brian Salomonbf6b9792019-08-21 09:38:10 -0400367std::unique_ptr<GrRenderTargetContext> GrRecordingContextPriv::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400368 SkBackingFit fit,
369 int width,
370 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400371 GrColorType colorType,
372 sk_sp<SkColorSpace> colorSpace,
373 int sampleCnt,
374 GrMipMapped mipMapped,
375 GrSurfaceOrigin origin,
376 const SkSurfaceProps* surfaceProps,
377 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400378 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400379 return fContext->makeDeferredRenderTargetContext(fit, width, height, colorType,
Robert Phillipsb97da532019-02-12 15:24:12 -0500380 std::move(colorSpace), sampleCnt, mipMapped,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400381 origin, surfaceProps, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500382}
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500383
Brian Salomonbf6b9792019-08-21 09:38:10 -0400384std::unique_ptr<GrRenderTargetContext>
385GrRecordingContextPriv::makeDeferredRenderTargetContextWithFallback(
Brian Salomond6287472019-06-24 15:50:07 -0400386 SkBackingFit fit,
387 int width,
388 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400389 GrColorType colorType,
390 sk_sp<SkColorSpace> colorSpace,
391 int sampleCnt,
392 GrMipMapped mipMapped,
393 GrSurfaceOrigin origin,
394 const SkSurfaceProps* surfaceProps,
395 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400396 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400397 return fContext->makeDeferredRenderTargetContextWithFallback(fit,
Brian Salomond6287472019-06-24 15:50:07 -0400398 width,
399 height,
Brian Salomond6287472019-06-24 15:50:07 -0400400 colorType,
401 std::move(colorSpace),
402 sampleCnt,
403 mipMapped,
404 origin,
405 surfaceProps,
406 budgeted,
407 isProtected);
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500408}
Robert Phillips9338c602019-02-19 12:52:29 -0500409
410GrContext* GrRecordingContextPriv::backdoor() {
411 return (GrContext*) fContext;
412}
Greg Daniel7bfc9132019-08-14 14:23:53 -0400413