blob: b7f9d4677f4be390d37652816418ad5701a29e29 [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
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500140// some GrGeometryProcessors, GrPipelines and GrProgramInfos
141SkArenaAlloc* GrRecordingContext::recordTimeAllocator() {
142 if (!fRecordTimeAllocator) {
Robert Phillips61fc7992019-10-22 11:58:17 -0400143 // TODO: empirically determine a better number for SkArenaAlloc's firstHeapAllocation param
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500144 fRecordTimeAllocator = std::unique_ptr<SkArenaAlloc>(
145 new SkArenaAlloc(sizeof(GrPipeline) * 100));
Robert Phillips61fc7992019-10-22 11:58:17 -0400146 }
147
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500148 SkASSERT(fRecordTimeAllocator);
149 return fRecordTimeAllocator.get();
Robert Phillips61fc7992019-10-22 11:58:17 -0400150}
151
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500152std::unique_ptr<SkArenaAlloc> GrRecordingContext::detachRecordTimeAllocator() {
153 return std::move(fRecordTimeAllocator);
Robert Phillips61fc7992019-10-22 11:58:17 -0400154}
155
Robert Phillips2184fb72019-02-21 16:11:41 -0500156GrTextBlobCache* GrRecordingContext::getTextBlobCache() {
157 return fTextBlobCache.get();
158}
159
160const GrTextBlobCache* GrRecordingContext::getTextBlobCache() const {
161 return fTextBlobCache.get();
162}
163
Robert Phillipsc5058a62019-02-15 12:52:59 -0500164void GrRecordingContext::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
165 this->drawingManager()->addOnFlushCallbackObject(onFlushCBObject);
166}
167
Brian Salomonbf6b9792019-08-21 09:38:10 -0400168std::unique_ptr<GrSurfaceContext> GrRecordingContext::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400169 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400170 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400171 SkAlphaType alphaType,
172 sk_sp<SkColorSpace> colorSpace,
173 const SkSurfaceProps* props) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500174 ASSERT_SINGLE_OWNER_PRIV
175
Brian Salomon9d8cac82019-07-16 15:59:31 -0400176 SkASSERT(proxy);
177
Robert Phillips292a6b22019-02-14 14:49:02 -0500178 if (proxy->asRenderTargetProxy()) {
Brian Salomone7499c72019-06-24 12:12:36 -0400179 SkASSERT(kPremul_SkAlphaType == alphaType || kOpaque_SkAlphaType == alphaType);
Brian Salomond6287472019-06-24 15:50:07 -0400180 return this->drawingManager()->makeRenderTargetContext(std::move(proxy), colorType,
Robert Phillips292a6b22019-02-14 14:49:02 -0500181 std::move(colorSpace), props);
182 } else {
183 SkASSERT(proxy->asTextureProxy());
184 SkASSERT(!props);
Brian Salomond6287472019-06-24 15:50:07 -0400185 return this->drawingManager()->makeTextureContext(std::move(proxy), colorType, alphaType,
Brian Salomone7499c72019-06-24 12:12:36 -0400186 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500187 }
188}
189
Brian Salomonbf6b9792019-08-21 09:38:10 -0400190std::unique_ptr<GrTextureContext> GrRecordingContext::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400191 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400192 int width,
193 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400194 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400195 SkAlphaType alphaType,
196 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400197 GrMipMapped mipMapped,
198 GrSurfaceOrigin origin,
199 SkBudgeted budgeted,
200 GrProtected isProtected) {
Robert Phillips0a15cc62019-07-30 12:49:10 -0400201 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kNo);
Brian Salomon947efe22019-07-16 15:36:11 -0400202 if (!format.isValid()) {
203 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500204 }
Brian Salomon947efe22019-07-16 15:36:11 -0400205 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
206 if (config == kUnknown_GrPixelConfig) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500207 return nullptr;
208 }
209
Brian Salomon947efe22019-07-16 15:36:11 -0400210 GrSurfaceDesc desc;
211 desc.fWidth = width;
212 desc.fHeight = height;
Brian Salomon947efe22019-07-16 15:36:11 -0400213 desc.fConfig = config;
214
Brian Salomonbeb7f522019-08-30 16:19:42 -0400215 sk_sp<GrTextureProxy> texture = this->proxyProvider()->createProxy(
216 format, desc, GrRenderable::kNo, 1, origin, mipMapped, fit, budgeted, isProtected);
Brian Salomon947efe22019-07-16 15:36:11 -0400217 if (!texture) {
218 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500219 }
220
Brian Salomon947efe22019-07-16 15:36:11 -0400221 auto drawingManager = this->drawingManager();
222
223 return drawingManager->makeTextureContext(std::move(texture), colorType, alphaType,
224 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500225}
226
Brian Salomonbf6b9792019-08-21 09:38:10 -0400227std::unique_ptr<GrRenderTargetContext> GrRecordingContext::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400228 SkBackingFit fit,
229 int width,
230 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400231 GrColorType colorType,
232 sk_sp<SkColorSpace> colorSpace,
233 int sampleCnt,
234 GrMipMapped mipMapped,
235 GrSurfaceOrigin origin,
236 const SkSurfaceProps* surfaceProps,
237 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400238 GrProtected isProtected) {
Robert Phillipsb97da532019-02-12 15:24:12 -0500239 SkASSERT(sampleCnt > 0);
240 if (this->abandoned()) {
241 return nullptr;
242 }
243
Robert Phillips0a15cc62019-07-30 12:49:10 -0400244 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kYes);
Brian Salomon27ae52c2019-07-03 11:27:44 -0400245 if (!format.isValid()) {
246 return nullptr;
247 }
248 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
249 if (config == kUnknown_GrPixelConfig) {
250 return nullptr;
251 }
252
Robert Phillipsb97da532019-02-12 15:24:12 -0500253 GrSurfaceDesc desc;
Robert Phillipsb97da532019-02-12 15:24:12 -0500254 desc.fWidth = width;
255 desc.fHeight = height;
256 desc.fConfig = config;
Robert Phillipsb97da532019-02-12 15:24:12 -0500257
Brian Salomonbeb7f522019-08-30 16:19:42 -0400258 sk_sp<GrTextureProxy> rtp =
259 this->proxyProvider()->createProxy(format, desc, GrRenderable::kYes, sampleCnt, origin,
260 mipMapped, fit, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500261 if (!rtp) {
262 return nullptr;
263 }
264
Robert Phillipsb97da532019-02-12 15:24:12 -0500265 auto drawingManager = this->drawingManager();
266
Brian Salomonbf6b9792019-08-21 09:38:10 -0400267 auto renderTargetContext = drawingManager->makeRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400268 std::move(rtp), colorType, std::move(colorSpace), surfaceProps);
Robert Phillipsb97da532019-02-12 15:24:12 -0500269 if (!renderTargetContext) {
270 return nullptr;
271 }
272
273 renderTargetContext->discard();
274
275 return renderTargetContext;
276}
Robert Phillipsd6841482019-02-08 10:29:20 -0500277
Brian Salomon27ae52c2019-07-03 11:27:44 -0400278static inline GrColorType color_type_fallback(GrColorType ct) {
279 switch (ct) {
280 // kRGBA_8888 is our default fallback for many color types that may not have renderable
281 // backend formats.
Brian Salomond6287472019-06-24 15:50:07 -0400282 case GrColorType::kAlpha_8:
Brian Salomond6287472019-06-24 15:50:07 -0400283 case GrColorType::kBGR_565:
Brian Salomond6287472019-06-24 15:50:07 -0400284 case GrColorType::kABGR_4444:
Brian Salomond6287472019-06-24 15:50:07 -0400285 case GrColorType::kBGRA_8888:
Brian Salomond6287472019-06-24 15:50:07 -0400286 case GrColorType::kRGBA_1010102:
Brian Salomond6287472019-06-24 15:50:07 -0400287 case GrColorType::kRGBA_F16:
Brian Salomond6287472019-06-24 15:50:07 -0400288 case GrColorType::kRGBA_F16_Clamped:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400289 return GrColorType::kRGBA_8888;
Brian Salomond6287472019-06-24 15:50:07 -0400290 case GrColorType::kAlpha_F16:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400291 return GrColorType::kRGBA_F16;
Brian Salomond6287472019-06-24 15:50:07 -0400292 case GrColorType::kGray_8:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400293 return GrColorType::kRGB_888x;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500294 default:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400295 return GrColorType::kUnknown;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500296 }
297}
298
Brian Salomonbf6b9792019-08-21 09:38:10 -0400299std::unique_ptr<GrRenderTargetContext>
300GrRecordingContext::makeDeferredRenderTargetContextWithFallback(SkBackingFit fit,
301 int width,
302 int height,
303 GrColorType colorType,
304 sk_sp<SkColorSpace> colorSpace,
305 int sampleCnt,
306 GrMipMapped mipMapped,
307 GrSurfaceOrigin origin,
308 const SkSurfaceProps* surfaceProps,
309 SkBudgeted budgeted,
310 GrProtected isProtected) {
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500311 SkASSERT(sampleCnt > 0);
Brian Salomonbf6b9792019-08-21 09:38:10 -0400312 std::unique_ptr<GrRenderTargetContext> rtc;
Brian Salomon27ae52c2019-07-03 11:27:44 -0400313 do {
314 rtc = this->makeDeferredRenderTargetContext(fit, width, height, colorType, colorSpace,
315 sampleCnt, mipMapped, origin, surfaceProps,
316 budgeted, isProtected);
317 colorType = color_type_fallback(colorType);
318 } while (!rtc && colorType != GrColorType::kUnknown);
319 return rtc;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500320}
321
Robert Phillipsa41c6852019-02-07 10:44:10 -0500322///////////////////////////////////////////////////////////////////////////////////////////////////
323sk_sp<const GrCaps> GrRecordingContextPriv::refCaps() const {
324 return fContext->refCaps();
325}
326
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500327std::unique_ptr<SkArenaAlloc> GrRecordingContextPriv::detachRecordTimeAllocator() {
328 return fContext->detachRecordTimeAllocator();
Robert Phillips61fc7992019-10-22 11:58:17 -0400329}
330
Robert Phillipsa41c6852019-02-07 10:44:10 -0500331sk_sp<GrSkSLFPFactoryCache> GrRecordingContextPriv::fpFactoryCache() {
332 return fContext->fpFactoryCache();
333}
Robert Phillipsd6841482019-02-08 10:29:20 -0500334
335sk_sp<GrOpMemoryPool> GrRecordingContextPriv::refOpMemoryPool() {
336 return fContext->refOpMemoryPool();
337}
Robert Phillipsb97da532019-02-12 15:24:12 -0500338
Robert Phillipsc5058a62019-02-15 12:52:59 -0500339void GrRecordingContextPriv::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
340 fContext->addOnFlushCallbackObject(onFlushCBObject);
341}
342
Brian Salomonbf6b9792019-08-21 09:38:10 -0400343std::unique_ptr<GrSurfaceContext> GrRecordingContextPriv::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400344 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400345 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400346 SkAlphaType alphaType,
347 sk_sp<SkColorSpace> colorSpace,
348 const SkSurfaceProps* props) {
Brian Salomond6287472019-06-24 15:50:07 -0400349 return fContext->makeWrappedSurfaceContext(std::move(proxy), colorType, alphaType,
350 std::move(colorSpace), props);
Robert Phillips292a6b22019-02-14 14:49:02 -0500351}
352
Brian Salomonbf6b9792019-08-21 09:38:10 -0400353std::unique_ptr<GrTextureContext> GrRecordingContextPriv::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400354 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400355 int width,
356 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400357 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400358 SkAlphaType alphaType,
359 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400360 GrMipMapped mipMapped,
361 GrSurfaceOrigin origin,
362 SkBudgeted budgeted,
363 GrProtected isProtected) {
364 return fContext->makeDeferredTextureContext(fit, width, height, colorType, alphaType,
365 std::move(colorSpace), mipMapped, origin, budgeted,
366 isProtected);
Robert Phillips292a6b22019-02-14 14:49:02 -0500367}
368
Brian Salomonbf6b9792019-08-21 09:38:10 -0400369std::unique_ptr<GrRenderTargetContext> GrRecordingContextPriv::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400370 SkBackingFit fit,
371 int width,
372 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400373 GrColorType colorType,
374 sk_sp<SkColorSpace> colorSpace,
375 int sampleCnt,
376 GrMipMapped mipMapped,
377 GrSurfaceOrigin origin,
378 const SkSurfaceProps* surfaceProps,
379 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400380 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400381 return fContext->makeDeferredRenderTargetContext(fit, width, height, colorType,
Robert Phillipsb97da532019-02-12 15:24:12 -0500382 std::move(colorSpace), sampleCnt, mipMapped,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400383 origin, surfaceProps, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500384}
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500385
Brian Salomonbf6b9792019-08-21 09:38:10 -0400386std::unique_ptr<GrRenderTargetContext>
387GrRecordingContextPriv::makeDeferredRenderTargetContextWithFallback(
Brian Salomond6287472019-06-24 15:50:07 -0400388 SkBackingFit fit,
389 int width,
390 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400391 GrColorType colorType,
392 sk_sp<SkColorSpace> colorSpace,
393 int sampleCnt,
394 GrMipMapped mipMapped,
395 GrSurfaceOrigin origin,
396 const SkSurfaceProps* surfaceProps,
397 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400398 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400399 return fContext->makeDeferredRenderTargetContextWithFallback(fit,
Brian Salomond6287472019-06-24 15:50:07 -0400400 width,
401 height,
Brian Salomond6287472019-06-24 15:50:07 -0400402 colorType,
403 std::move(colorSpace),
404 sampleCnt,
405 mipMapped,
406 origin,
407 surfaceProps,
408 budgeted,
409 isProtected);
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500410}
Robert Phillips9338c602019-02-19 12:52:29 -0500411
412GrContext* GrRecordingContextPriv::backdoor() {
413 return (GrContext*) fContext;
414}
Greg Daniel7bfc9132019-08-14 14:23:53 -0400415