MCPcopy Create free account
hub / github.com/Tencent/tgfx / wrapExternalTexture

Method wrapExternalTexture

src/gpu/ProxyProvider.cpp:342–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342std::shared_ptr<TextureProxy> ProxyProvider::wrapExternalTexture(
343 const BackendTexture& backendTexture, ImageOrigin origin, bool adopted) {
344 auto textureView = TextureView::MakeFrom(context, backendTexture, origin, adopted);
345 if (textureView == nullptr) {
346 return nullptr;
347 }
348 auto format = context->gpu()->getExternalTextureFormat(backendTexture);
349 auto proxy = std::shared_ptr<TextureProxy>(
350 new TextureProxy(textureView->width(), textureView->height(), format,
351 textureView->hasMipmaps(), textureView->origin()));
352 proxy->resource = std::move(textureView);
353 addResourceProxy(proxy);
354 return proxy;
355}
356
357std::shared_ptr<RenderTargetProxy> ProxyProvider::createRenderTargetProxy(
358 const BackendTexture& backendTexture, int sampleCount, ImageOrigin origin, bool adopted) {

Callers 2

MakeFromMethod · 0.80
MakeAdoptedMethod · 0.80

Calls 6

gpuMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45
hasMipmapsMethod · 0.45
originMethod · 0.45

Tested by

no test coverage detected