MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / astcenc_compress_cancel

Function astcenc_compress_cancel

Source/astcenc_entry.cpp:1251–1271  ·  view source on GitHub ↗

See header for documentation. */

Source from the content-addressed store, hash-verified

1249
1250/* See header for documentation. */
1251astcenc_error astcenc_compress_cancel(
1252 astcenc_context* ctxo
1253) {
1254#if defined(ASTCENC_DECOMPRESS_ONLY)
1255 (void)ctxo;
1256 return ASTCENC_ERR_BAD_CONTEXT;
1257#else
1258 astcenc_contexti* ctx = &ctxo->context;
1259 if (ctx->config.flags & ASTCENC_FLG_DECOMPRESS_ONLY)
1260 {
1261 return ASTCENC_ERR_BAD_CONTEXT;
1262 }
1263
1264 // Cancel compression before cancelling avg. This avoids the race condition
1265 // where cancelling them in the other order could see a compression worker
1266 // starting to process even though some of the avg data is undefined.
1267 ctxo->manage_compress.cancel();
1268 ctxo->manage_avg.cancel();
1269 return ASTCENC_SUCCESS;
1270#endif
1271}
1272
1273/* See header for documentation. */
1274astcenc_error astcenc_decompress_image(

Callers

nothing calls this directly

Calls 1

cancelMethod · 0.80

Tested by

no test coverage detected