1 //
2 // Copyright 2022 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6
7 // AstcDecompressorNoOp.cpp: No-op implementation if support for ASTC textures wasn't enabled
8
9 #include "image_util/AstcDecompressor.h"
10
11 namespace angle
12 {
13
14 namespace
15 {
16
17 class AstcDecompressorNoOp : public AstcDecompressor
18 {
19 public:
available() const20 bool available() const override { return false; }
21
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 * astcData,size_t astcDataLength,uint8_t * output)22 int32_t decompress(std::shared_ptr<WorkerThreadPool> singleThreadPool,
23 std::shared_ptr<WorkerThreadPool> multiThreadPool,
24 uint32_t imgWidth,
25 uint32_t imgHeight,
26 uint32_t blockWidth,
27 uint32_t blockHeight,
28 const uint8_t *astcData,
29 size_t astcDataLength,
30 uint8_t *output) override
31 {
32 return -1;
33 }
34
getStatusString(int32_t statusCode) const35 const char *getStatusString(int32_t statusCode) const override
36 {
37 return "ASTC CPU decomp not available";
38 }
39 };
40
41 } // namespace
42
get()43 AstcDecompressor &AstcDecompressor::get()
44 {
45 static AstcDecompressorNoOp *instance = new AstcDecompressorNoOp();
46 return *instance;
47 }
48
49 } // namespace angle
50