Flutter Engine
The Flutter Engine
third_party
skia
src
core
SkCompressedDataUtils.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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
8
#ifndef SkCompressedDataUtils_DEFINED
9
#define SkCompressedDataUtils_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/core/SkTextureCompressionType.h
"
13
#include "
include/private/base/SkAssert.h
"
14
#include "
include/private/base/SkTArray.h
"
15
16
#include <cstddef>
17
18
class
SkBitmap
;
19
class
SkData
;
20
struct
SkISize
;
21
22
static
constexpr
bool
SkTextureCompressionTypeIsOpaque
(
SkTextureCompressionType
compression) {
23
switch
(compression) {
24
case
SkTextureCompressionType::kNone
:
return
true
;
25
case
SkTextureCompressionType::kETC2_RGB8_UNORM
:
return
true
;
26
case
SkTextureCompressionType::kBC1_RGB8_UNORM
:
return
true
;
27
case
SkTextureCompressionType::kBC1_RGBA8_UNORM
:
return
false
;
28
}
29
30
SkUNREACHABLE
;
31
}
32
33
size_t
SkCompressedDataSize
(
SkTextureCompressionType
,
SkISize
baseDimensions,
34
skia_private::TArray<size_t>
* individualMipOffsets,
bool
mipmapped);
35
size_t
SkCompressedBlockSize
(
SkTextureCompressionType
type
);
36
37
/**
38
* Returns the data size for the given SkTextureCompressionType
39
*/
40
size_t
SkCompressedFormatDataSize
(
SkTextureCompressionType
compressionType,
41
SkISize
dimensions,
bool
mipmapped);
42
43
/*
44
* This method will decompress the bottommost level in 'data' into 'dst'.
45
*/
46
bool
SkDecompress
(
sk_sp<SkData>
data
,
47
SkISize
dimensions,
48
SkTextureCompressionType
compressionType,
49
SkBitmap
*
dst
);
50
51
#endif
SkAssert.h
SkUNREACHABLE
#define SkUNREACHABLE
Definition:
SkAssert.h:135
SkDecompress
bool SkDecompress(sk_sp< SkData > data, SkISize dimensions, SkTextureCompressionType compressionType, SkBitmap *dst)
Definition:
SkCompressedDataUtils.cpp:237
SkTextureCompressionTypeIsOpaque
static constexpr bool SkTextureCompressionTypeIsOpaque(SkTextureCompressionType compression)
Definition:
SkCompressedDataUtils.h:22
SkCompressedFormatDataSize
size_t SkCompressedFormatDataSize(SkTextureCompressionType compressionType, SkISize dimensions, bool mipmapped)
Definition:
SkCompressedDataUtils.cpp:303
SkCompressedDataSize
size_t SkCompressedDataSize(SkTextureCompressionType, SkISize baseDimensions, skia_private::TArray< size_t > *individualMipOffsets, bool mipmapped)
Definition:
SkCompressedDataUtils.cpp:254
SkCompressedBlockSize
size_t SkCompressedBlockSize(SkTextureCompressionType type)
Definition:
SkCompressedDataUtils.cpp:290
SkRefCnt.h
SkTArray.h
SkTextureCompressionType.h
SkTextureCompressionType
SkTextureCompressionType
Definition:
SkTextureCompressionType.h:20
SkTextureCompressionType::kBC1_RGBA8_UNORM
@ kBC1_RGBA8_UNORM
SkTextureCompressionType::kNone
@ kNone
SkTextureCompressionType::kETC2_RGB8_UNORM
@ kETC2_RGB8_UNORM
SkTextureCompressionType::kBC1_RGB8_UNORM
@ kBC1_RGB8_UNORM
type
GLenum type
Definition:
blit_command_gles.cc:126
SkBitmap
Definition:
SkBitmap.h:59
SkData
Definition:
SkData.h:25
sk_sp< SkData >
skia_private::TArray
Definition:
SkTArray.h:40
gn.cp.dst
dst
Definition:
cp.py:12
SkISize
Definition:
SkSize.h:16
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:11 for Flutter Engine by
1.9.4