Hash :
e0fafcdf
Author :
Date :
2024-12-10T17:46:44
add missing includes for the build with use_libcxx_modules This is to fix build error when we set use_libcxx_modules=true in chromium build. Bug: chromium:40440396 Change-Id: Ic1f2655b91eaf949150d61a9a42c0ee0221afac9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6084012 Auto-Submit: Takuto Ikuta <tikuta@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// AstcDecompressor.h: Decodes ASTC-encoded textures.
#ifndef IMAGE_UTIL_ASTC_CPU_DECOMPRESSOR_H_
#define IMAGE_UTIL_ASTC_CPU_DECOMPRESSOR_H_
#include <stdint.h>
#include <memory>
#include <string>
namespace angle
{
class WorkerThreadPool;
// This class is responsible for decompressing ASTC textures on the CPU.
// This class is thread-safe and all its methods can be called by any thread.
class AstcDecompressor
{
public:
// Returns the global singleton instance of this class.
static AstcDecompressor &get();
virtual ~AstcDecompressor() = default;
// Whether the ASTC decompressor is available. Reasons why it may not be available include:
// - It wasn't compiled on this platform.
// - The CPU doesn't support AVX2 instructions.
// If this returns false, decompress() will fail.
virtual bool available() const = 0;
// Decompress an ASTC texture.
//
// singleThreadPool: a thread pool that runs tasks on the current thread. Must not be null.
// multiThreadPool: (optional) a multi-threaded pool. If non-null, this will be used if the
// image is large enough to benefit from it.
// imgWidth, imgHeight: width and height of the texture, in texels.
// blockWidth, blockHeight: ASTC encoding block size.
// input: pointer to the ASTC data to decompress
// inputLength: size of astData
// output: where to white the decompressed output. This buffer must be able to hold at least
// imgWidth * imgHeight * 4 bytes.
//
// Returns 0 on success, or a non-zero status code on error. Use getStatusString() to convert
// this status code to an error string.
virtual int32_t decompress(std::shared_ptr<WorkerThreadPool> singleThreadPool,
std::shared_ptr<WorkerThreadPool> multiThreadPool,
uint32_t imgWidth,
uint32_t imgHeight,
uint32_t blockWidth,
uint32_t blockHeight,
const uint8_t *input,
size_t inputLength,
uint8_t *output) = 0;
// Returns an error string for a given status code. Will always return non-null.
virtual const char *getStatusString(int32_t statusCode) const = 0;
};
} // namespace angle
#endif // IMAGE_UTIL_ASTC_CPU_DECOMPRESSOR_H_