blob: cf38a2166961a2f92b9a784e56e539df19b2708f [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"
Robert Phillips7f11fb52019-12-03 13:35:19 -050022#include "src/gpu/effects/GrSkSLFP.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050023#include "src/gpu/text/GrTextBlobCache.h"
Robert Phillipsa41c6852019-02-07 10:44:10 -050024
Robert Phillips292a6b22019-02-14 14:49:02 -050025#define ASSERT_SINGLE_OWNER_PRIV \
26 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());)
27
Robert Phillipsc1541ae2019-02-04 12:05:37 -050028GrRecordingContext::GrRecordingContext(GrBackendApi backend,
29 const GrContextOptions& options,
Robert Phillipsa41c6852019-02-07 10:44:10 -050030 uint32_t contextID)
Greg Danielf91aeb22019-06-18 09:58:02 -040031 : INHERITED(backend, options, contextID)
32 , fAuditTrail(new GrAuditTrail()) {
Robert Phillips4217ea72019-01-30 13:08:28 -050033}
34
35GrRecordingContext::~GrRecordingContext() { }
36
Robert Phillips2184fb72019-02-21 16:11:41 -050037/**
38 * TODO: move textblob draw calls below context (see comment below)
39 */
40static void textblobcache_overbudget_CB(void* data) {
41 SkASSERT(data);
42 GrRecordingContext* context = reinterpret_cast<GrRecordingContext*>(data);
43
44 GrContext* direct = context->priv().asDirectContext();
45 if (!direct) {
46 return;
47 }
48
49 // TextBlobs are drawn at the SkGpuDevice level, therefore they cannot rely on
50 // GrRenderTargetContext to perform a necessary flush. The solution is to move drawText calls
51 // to below the GrContext level, but this is not trivial because they call drawPath on
52 // SkGpuDevice.
53 direct->flush();
54}
55
Robert Phillips292a6b22019-02-14 14:49:02 -050056bool GrRecordingContext::init(sk_sp<const GrCaps> caps, sk_sp<GrSkSLFPFactoryCache> cache) {
57
58 if (!INHERITED::init(std::move(caps), std::move(cache))) {
59 return false;
60 }
61
Herb Derbya00da612019-03-04 17:10:01 -050062 fStrikeCache.reset(new GrStrikeCache(this->caps(),
Robert Phillips2184fb72019-02-21 16:11:41 -050063 this->options().fGlyphCacheTextureMaximumBytes));
64
65 fTextBlobCache.reset(new GrTextBlobCache(textblobcache_overbudget_CB, this,
66 this->contextID()));
67
Robert Phillips56181ba2019-03-08 12:00:45 -050068 return true;
69}
70
Greg Danielf41b2bd2019-08-22 16:19:24 -040071void GrRecordingContext::setupDrawingManager(bool sortOpsTasks, bool reduceOpsTaskSplitting) {
Robert Phillips69893702019-02-22 11:16:30 -050072 GrPathRendererChain::Options prcOptions;
73 prcOptions.fAllowPathMaskCaching = this->options().fAllowPathMaskCaching;
74#if GR_TEST_UTILS
75 prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
76#endif
Chris Daltonf7748182019-03-18 16:22:30 +000077 // FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
78 if (!this->options().fDisableCoverageCountingPaths) {
79 prcOptions.fGpuPathRenderers |= GpuPathRenderers::kCoverageCounting;
Robert Phillips69893702019-02-22 11:16:30 -050080 }
81 if (this->options().fDisableDistanceFieldPaths) {
82 prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
83 }
84
85 if (!this->proxyProvider()->renderingDirectly()) {
86 // DDL TODO: remove this crippling of the path renderer chain
87 // Disable the small path renderer bc of the proxies in the atlas. They need to be
Greg Danielf41b2bd2019-08-22 16:19:24 -040088 // unified when the opsTasks are added back to the destination drawing manager.
Robert Phillips69893702019-02-22 11:16:30 -050089 prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
90 }
91
92 GrTextContext::Options textContextOptions;
93 textContextOptions.fMaxDistanceFieldFontSize = this->options().fGlyphsAsPathsFontSize;
94 textContextOptions.fMinDistanceFieldFontSize = this->options().fMinDistanceFieldFontSize;
95 textContextOptions.fDistanceFieldVerticesAlwaysHaveW = false;
96#if SK_SUPPORT_ATLAS_TEXT
97 if (GrContextOptions::Enable::kYes == this->options().fDistanceFieldGlyphVerticesAlwaysHaveW) {
98 textContextOptions.fDistanceFieldVerticesAlwaysHaveW = true;
99 }
100#endif
101
102 fDrawingManager.reset(new GrDrawingManager(this,
Robert Phillips12c46292019-04-23 07:36:17 -0400103 prcOptions,
104 textContextOptions,
Greg Danielf41b2bd2019-08-22 16:19:24 -0400105 sortOpsTasks,
106 reduceOpsTaskSplitting));
Robert Phillips292a6b22019-02-14 14:49:02 -0500107}
108
Robert Phillipsa9162df2019-02-11 14:12:03 -0500109void GrRecordingContext::abandonContext() {
110 INHERITED::abandonContext();
Robert Phillips2184fb72019-02-21 16:11:41 -0500111
Herb Derbya00da612019-03-04 17:10:01 -0500112 fStrikeCache->freeAll();
Robert Phillips2184fb72019-02-21 16:11:41 -0500113 fTextBlobCache->freeAll();
Robert Phillipsa9162df2019-02-11 14:12:03 -0500114}
115
Robert Phillips69893702019-02-22 11:16:30 -0500116GrDrawingManager* GrRecordingContext::drawingManager() {
117 return fDrawingManager.get();
118}
119
Michael Ludwigcb10e4d2019-12-12 13:59:20 -0500120GrOpMemoryPool* GrRecordingContext::opMemoryPool() {
Robert Phillipsd6841482019-02-08 10:29:20 -0500121 if (!fOpMemoryPool) {
122 // DDL TODO: should the size of the memory pool be decreased in DDL mode? CPU-side memory
123 // consumed in DDL mode vs. normal mode for a single skp might be a good metric of wasted
124 // memory.
Brian Salomon6986c652019-12-12 10:58:47 -0500125 fOpMemoryPool = GrOpMemoryPool::Make(16384, 16384);
Robert Phillipsd6841482019-02-08 10:29:20 -0500126 }
127
Michael Ludwigcb10e4d2019-12-12 13:59:20 -0500128 return fOpMemoryPool.get();
Robert Phillipsd6841482019-02-08 10:29:20 -0500129}
130
Michael Ludwigcb10e4d2019-12-12 13:59:20 -0500131std::unique_ptr<GrOpMemoryPool> GrRecordingContext::detachOpMemoryPool() {
132 return std::move(fOpMemoryPool);
Robert Phillipsd6841482019-02-08 10:29:20 -0500133}
134
Robert Phillips61fc7992019-10-22 11:58:17 -0400135// Stored in this arena:
136// GrTextureOp's DynamicStateArrays and FixedDynamicState
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500137// some GrGeometryProcessors, GrPipelines and GrProgramInfos
138SkArenaAlloc* GrRecordingContext::recordTimeAllocator() {
139 if (!fRecordTimeAllocator) {
Robert Phillips61fc7992019-10-22 11:58:17 -0400140 // TODO: empirically determine a better number for SkArenaAlloc's firstHeapAllocation param
Michael Ludwigcb10e4d2019-12-12 13:59:20 -0500141 fRecordTimeAllocator = std::make_unique<SkArenaAlloc>(sizeof(GrPipeline) * 100);
Robert Phillips61fc7992019-10-22 11:58:17 -0400142 }
143
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500144 return fRecordTimeAllocator.get();
Robert Phillips61fc7992019-10-22 11:58:17 -0400145}
146
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500147std::unique_ptr<SkArenaAlloc> GrRecordingContext::detachRecordTimeAllocator() {
148 return std::move(fRecordTimeAllocator);
Robert Phillips61fc7992019-10-22 11:58:17 -0400149}
150
Robert Phillips2184fb72019-02-21 16:11:41 -0500151GrTextBlobCache* GrRecordingContext::getTextBlobCache() {
152 return fTextBlobCache.get();
153}
154
155const GrTextBlobCache* GrRecordingContext::getTextBlobCache() const {
156 return fTextBlobCache.get();
157}
158
Robert Phillipsc5058a62019-02-15 12:52:59 -0500159void GrRecordingContext::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
160 this->drawingManager()->addOnFlushCallbackObject(onFlushCBObject);
161}
162
Brian Salomonbf6b9792019-08-21 09:38:10 -0400163std::unique_ptr<GrSurfaceContext> GrRecordingContext::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400164 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400165 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400166 SkAlphaType alphaType,
167 sk_sp<SkColorSpace> colorSpace,
168 const SkSurfaceProps* props) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500169 ASSERT_SINGLE_OWNER_PRIV
170
Brian Salomon9d8cac82019-07-16 15:59:31 -0400171 SkASSERT(proxy);
172
Robert Phillips292a6b22019-02-14 14:49:02 -0500173 if (proxy->asRenderTargetProxy()) {
Brian Salomone7499c72019-06-24 12:12:36 -0400174 SkASSERT(kPremul_SkAlphaType == alphaType || kOpaque_SkAlphaType == alphaType);
Brian Salomond6287472019-06-24 15:50:07 -0400175 return this->drawingManager()->makeRenderTargetContext(std::move(proxy), colorType,
Robert Phillips292a6b22019-02-14 14:49:02 -0500176 std::move(colorSpace), props);
177 } else {
178 SkASSERT(proxy->asTextureProxy());
179 SkASSERT(!props);
Brian Salomond6287472019-06-24 15:50:07 -0400180 return this->drawingManager()->makeTextureContext(std::move(proxy), colorType, alphaType,
Brian Salomone7499c72019-06-24 12:12:36 -0400181 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500182 }
183}
184
Brian Salomonbf6b9792019-08-21 09:38:10 -0400185std::unique_ptr<GrTextureContext> GrRecordingContext::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400186 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400187 int width,
188 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400189 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400190 SkAlphaType alphaType,
191 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400192 GrMipMapped mipMapped,
193 GrSurfaceOrigin origin,
194 SkBudgeted budgeted,
195 GrProtected isProtected) {
Robert Phillips0a15cc62019-07-30 12:49:10 -0400196 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kNo);
Brian Salomon947efe22019-07-16 15:36:11 -0400197 if (!format.isValid()) {
198 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500199 }
Brian Salomon947efe22019-07-16 15:36:11 -0400200 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
201 if (config == kUnknown_GrPixelConfig) {
Robert Phillips292a6b22019-02-14 14:49:02 -0500202 return nullptr;
203 }
204
Brian Salomon947efe22019-07-16 15:36:11 -0400205 GrSurfaceDesc desc;
206 desc.fWidth = width;
207 desc.fHeight = height;
Brian Salomon947efe22019-07-16 15:36:11 -0400208 desc.fConfig = config;
209
Brian Salomonbeb7f522019-08-30 16:19:42 -0400210 sk_sp<GrTextureProxy> texture = this->proxyProvider()->createProxy(
211 format, desc, GrRenderable::kNo, 1, origin, mipMapped, fit, budgeted, isProtected);
Brian Salomon947efe22019-07-16 15:36:11 -0400212 if (!texture) {
213 return nullptr;
Robert Phillips292a6b22019-02-14 14:49:02 -0500214 }
215
Brian Salomon947efe22019-07-16 15:36:11 -0400216 auto drawingManager = this->drawingManager();
217
218 return drawingManager->makeTextureContext(std::move(texture), colorType, alphaType,
219 std::move(colorSpace));
Robert Phillips292a6b22019-02-14 14:49:02 -0500220}
221
Brian Salomonbf6b9792019-08-21 09:38:10 -0400222std::unique_ptr<GrRenderTargetContext> GrRecordingContext::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400223 SkBackingFit fit,
224 int width,
225 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400226 GrColorType colorType,
227 sk_sp<SkColorSpace> colorSpace,
228 int sampleCnt,
229 GrMipMapped mipMapped,
230 GrSurfaceOrigin origin,
231 const SkSurfaceProps* surfaceProps,
232 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400233 GrProtected isProtected) {
Robert Phillipsb97da532019-02-12 15:24:12 -0500234 SkASSERT(sampleCnt > 0);
235 if (this->abandoned()) {
236 return nullptr;
237 }
238
Robert Phillips0a15cc62019-07-30 12:49:10 -0400239 auto format = this->caps()->getDefaultBackendFormat(colorType, GrRenderable::kYes);
Brian Salomon27ae52c2019-07-03 11:27:44 -0400240 if (!format.isValid()) {
241 return nullptr;
242 }
243 auto config = this->caps()->getConfigFromBackendFormat(format, colorType);
244 if (config == kUnknown_GrPixelConfig) {
245 return nullptr;
246 }
247
Robert Phillipsb97da532019-02-12 15:24:12 -0500248 GrSurfaceDesc desc;
Robert Phillipsb97da532019-02-12 15:24:12 -0500249 desc.fWidth = width;
250 desc.fHeight = height;
251 desc.fConfig = config;
Robert Phillipsb97da532019-02-12 15:24:12 -0500252
Brian Salomonbeb7f522019-08-30 16:19:42 -0400253 sk_sp<GrTextureProxy> rtp =
254 this->proxyProvider()->createProxy(format, desc, GrRenderable::kYes, sampleCnt, origin,
255 mipMapped, fit, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500256 if (!rtp) {
257 return nullptr;
258 }
259
Robert Phillipsb97da532019-02-12 15:24:12 -0500260 auto drawingManager = this->drawingManager();
261
Brian Salomonbf6b9792019-08-21 09:38:10 -0400262 auto renderTargetContext = drawingManager->makeRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400263 std::move(rtp), colorType, std::move(colorSpace), surfaceProps);
Robert Phillipsb97da532019-02-12 15:24:12 -0500264 if (!renderTargetContext) {
265 return nullptr;
266 }
267
268 renderTargetContext->discard();
269
270 return renderTargetContext;
271}
Robert Phillipsd6841482019-02-08 10:29:20 -0500272
Brian Salomon27ae52c2019-07-03 11:27:44 -0400273static inline GrColorType color_type_fallback(GrColorType ct) {
274 switch (ct) {
275 // kRGBA_8888 is our default fallback for many color types that may not have renderable
276 // backend formats.
Brian Salomond6287472019-06-24 15:50:07 -0400277 case GrColorType::kAlpha_8:
Brian Salomond6287472019-06-24 15:50:07 -0400278 case GrColorType::kBGR_565:
Brian Salomond6287472019-06-24 15:50:07 -0400279 case GrColorType::kABGR_4444:
Brian Salomond6287472019-06-24 15:50:07 -0400280 case GrColorType::kBGRA_8888:
Brian Salomond6287472019-06-24 15:50:07 -0400281 case GrColorType::kRGBA_1010102:
Brian Salomond6287472019-06-24 15:50:07 -0400282 case GrColorType::kRGBA_F16:
Brian Salomond6287472019-06-24 15:50:07 -0400283 case GrColorType::kRGBA_F16_Clamped:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400284 return GrColorType::kRGBA_8888;
Brian Salomond6287472019-06-24 15:50:07 -0400285 case GrColorType::kAlpha_F16:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400286 return GrColorType::kRGBA_F16;
Brian Salomond6287472019-06-24 15:50:07 -0400287 case GrColorType::kGray_8:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400288 return GrColorType::kRGB_888x;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500289 default:
Brian Salomon27ae52c2019-07-03 11:27:44 -0400290 return GrColorType::kUnknown;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500291 }
292}
293
Brian Salomonbf6b9792019-08-21 09:38:10 -0400294std::unique_ptr<GrRenderTargetContext>
295GrRecordingContext::makeDeferredRenderTargetContextWithFallback(SkBackingFit fit,
296 int width,
297 int height,
298 GrColorType colorType,
299 sk_sp<SkColorSpace> colorSpace,
300 int sampleCnt,
301 GrMipMapped mipMapped,
302 GrSurfaceOrigin origin,
303 const SkSurfaceProps* surfaceProps,
304 SkBudgeted budgeted,
305 GrProtected isProtected) {
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500306 SkASSERT(sampleCnt > 0);
Brian Salomonbf6b9792019-08-21 09:38:10 -0400307 std::unique_ptr<GrRenderTargetContext> rtc;
Brian Salomon27ae52c2019-07-03 11:27:44 -0400308 do {
309 rtc = this->makeDeferredRenderTargetContext(fit, width, height, colorType, colorSpace,
310 sampleCnt, mipMapped, origin, surfaceProps,
311 budgeted, isProtected);
312 colorType = color_type_fallback(colorType);
313 } while (!rtc && colorType != GrColorType::kUnknown);
314 return rtc;
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500315}
316
Robert Phillipsa41c6852019-02-07 10:44:10 -0500317///////////////////////////////////////////////////////////////////////////////////////////////////
318sk_sp<const GrCaps> GrRecordingContextPriv::refCaps() const {
319 return fContext->refCaps();
320}
321
Michael Ludwigcb10e4d2019-12-12 13:59:20 -0500322std::unique_ptr<GrOpMemoryPool> GrRecordingContextPriv::detachOpMemoryPool() {
323 return fContext->detachOpMemoryPool();
324}
325
Robert Phillipsd4fb7c72019-11-15 17:28:37 -0500326std::unique_ptr<SkArenaAlloc> GrRecordingContextPriv::detachRecordTimeAllocator() {
327 return fContext->detachRecordTimeAllocator();
Robert Phillips61fc7992019-10-22 11:58:17 -0400328}
329
Robert Phillipsa41c6852019-02-07 10:44:10 -0500330sk_sp<GrSkSLFPFactoryCache> GrRecordingContextPriv::fpFactoryCache() {
331 return fContext->fpFactoryCache();
332}
Robert Phillipsd6841482019-02-08 10:29:20 -0500333
Robert Phillipsc5058a62019-02-15 12:52:59 -0500334void GrRecordingContextPriv::addOnFlushCallbackObject(GrOnFlushCallbackObject* onFlushCBObject) {
335 fContext->addOnFlushCallbackObject(onFlushCBObject);
336}
337
Brian Salomonbf6b9792019-08-21 09:38:10 -0400338std::unique_ptr<GrSurfaceContext> GrRecordingContextPriv::makeWrappedSurfaceContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400339 sk_sp<GrSurfaceProxy> proxy,
Brian Salomond6287472019-06-24 15:50:07 -0400340 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400341 SkAlphaType alphaType,
342 sk_sp<SkColorSpace> colorSpace,
343 const SkSurfaceProps* props) {
Brian Salomond6287472019-06-24 15:50:07 -0400344 return fContext->makeWrappedSurfaceContext(std::move(proxy), colorType, alphaType,
345 std::move(colorSpace), props);
Robert Phillips292a6b22019-02-14 14:49:02 -0500346}
347
Brian Salomonbf6b9792019-08-21 09:38:10 -0400348std::unique_ptr<GrTextureContext> GrRecordingContextPriv::makeDeferredTextureContext(
Brian Salomone7499c72019-06-24 12:12:36 -0400349 SkBackingFit fit,
Brian Salomon947efe22019-07-16 15:36:11 -0400350 int width,
351 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400352 GrColorType colorType,
Brian Salomone7499c72019-06-24 12:12:36 -0400353 SkAlphaType alphaType,
354 sk_sp<SkColorSpace> colorSpace,
Brian Salomon947efe22019-07-16 15:36:11 -0400355 GrMipMapped mipMapped,
356 GrSurfaceOrigin origin,
357 SkBudgeted budgeted,
358 GrProtected isProtected) {
359 return fContext->makeDeferredTextureContext(fit, width, height, colorType, alphaType,
360 std::move(colorSpace), mipMapped, origin, budgeted,
361 isProtected);
Robert Phillips292a6b22019-02-14 14:49:02 -0500362}
363
Brian Salomonbf6b9792019-08-21 09:38:10 -0400364std::unique_ptr<GrRenderTargetContext> GrRecordingContextPriv::makeDeferredRenderTargetContext(
Brian Salomond6287472019-06-24 15:50:07 -0400365 SkBackingFit fit,
366 int width,
367 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400368 GrColorType colorType,
369 sk_sp<SkColorSpace> colorSpace,
370 int sampleCnt,
371 GrMipMapped mipMapped,
372 GrSurfaceOrigin origin,
373 const SkSurfaceProps* surfaceProps,
374 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400375 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400376 return fContext->makeDeferredRenderTargetContext(fit, width, height, colorType,
Robert Phillipsb97da532019-02-12 15:24:12 -0500377 std::move(colorSpace), sampleCnt, mipMapped,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400378 origin, surfaceProps, budgeted, isProtected);
Robert Phillipsb97da532019-02-12 15:24:12 -0500379}
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500380
Brian Salomonbf6b9792019-08-21 09:38:10 -0400381std::unique_ptr<GrRenderTargetContext>
382GrRecordingContextPriv::makeDeferredRenderTargetContextWithFallback(
Brian Salomond6287472019-06-24 15:50:07 -0400383 SkBackingFit fit,
384 int width,
385 int height,
Brian Salomond6287472019-06-24 15:50:07 -0400386 GrColorType colorType,
387 sk_sp<SkColorSpace> colorSpace,
388 int sampleCnt,
389 GrMipMapped mipMapped,
390 GrSurfaceOrigin origin,
391 const SkSurfaceProps* surfaceProps,
392 SkBudgeted budgeted,
Emircan Uysaler23ca4e72019-06-24 10:53:09 -0400393 GrProtected isProtected) {
Brian Salomon27ae52c2019-07-03 11:27:44 -0400394 return fContext->makeDeferredRenderTargetContextWithFallback(fit,
Brian Salomond6287472019-06-24 15:50:07 -0400395 width,
396 height,
Brian Salomond6287472019-06-24 15:50:07 -0400397 colorType,
398 std::move(colorSpace),
399 sampleCnt,
400 mipMapped,
401 origin,
402 surfaceProps,
403 budgeted,
404 isProtected);
Robert Phillips6f0e02f2019-02-13 11:02:28 -0500405}
Robert Phillips9338c602019-02-19 12:52:29 -0500406
407GrContext* GrRecordingContextPriv::backdoor() {
408 return (GrContext*) fContext;
409}
Greg Daniel7bfc9132019-08-14 14:23:53 -0400410