Flutter Engine
The Flutter Engine
third_party
skia
src
core
SkMipmapBuilder.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
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
#include "
src/core/SkMipmapBuilder.h
"
8
9
#include "
include/core/SkImage.h
"
10
#include "
include/core/SkPixmap.h
"
11
#include "
include/core/SkTypes.h
"
12
#include "
src/core/SkMipmap.h
"
13
struct
SkImageInfo
;
14
15
SkMipmapBuilder::SkMipmapBuilder
(
const
SkImageInfo
&
info
) {
16
fMM =
sk_sp<SkMipmap>
(
SkMipmap::Build
({
info
,
nullptr
, 0},
17
/* factoryProc= */
nullptr
,
18
/* computeContents= */
false
));
19
}
20
21
SkMipmapBuilder::~SkMipmapBuilder
() {}
22
23
int
SkMipmapBuilder::countLevels
()
const
{
24
return
fMM ? fMM->
countLevels
() : 0;
25
}
26
27
SkPixmap
SkMipmapBuilder::level
(
int
index)
const
{
28
SkPixmap
pm;
29
30
SkMipmap::Level
level
;
31
if
(fMM && fMM->
getLevel
(index, &
level
)) {
32
pm =
level
.fPixmap;
33
}
34
return
pm;
35
}
36
37
sk_sp<SkImage>
SkMipmapBuilder::attachTo
(
const
sk_sp<const SkImage>
&
src
) {
38
return
src
->withMipmaps(fMM);
39
}
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
SkImage.h
SkMipmapBuilder.h
SkMipmap.h
SkPixmap.h
SkTypes.h
SkMipmapBuilder::~SkMipmapBuilder
~SkMipmapBuilder()
Definition:
SkMipmapBuilder.cpp:21
SkMipmapBuilder::countLevels
int countLevels() const
Definition:
SkMipmapBuilder.cpp:23
SkMipmapBuilder::attachTo
sk_sp< SkImage > attachTo(const sk_sp< const SkImage > &src)
Definition:
SkMipmapBuilder.cpp:37
SkMipmapBuilder::level
SkPixmap level(int index) const
Definition:
SkMipmapBuilder.cpp:27
SkMipmapBuilder::SkMipmapBuilder
SkMipmapBuilder(const SkImageInfo &)
Definition:
SkMipmapBuilder.cpp:15
SkMipmap::Build
static SkMipmap * Build(const SkPixmap &src, SkDiscardableFactoryProc, bool computeContents=true)
Definition:
SkMipmap.cpp:45
SkMipmap::countLevels
int countLevels() const
Definition:
SkMipmap.cpp:276
SkMipmap::getLevel
bool getLevel(int index, Level *) const
Definition:
SkMipmap.cpp:280
SkPixmap
Definition:
SkPixmap.h:40
sk_sp< SkMipmap >
mskp_parser.src
src
Definition:
mskp_parser.py:22
SkImageInfo
Definition:
SkImageInfo.h:208
SkMipmap::Level
Definition:
SkMipmap.h:70
Generated on Sun Jun 23 2024 21:56:13 for Flutter Engine by
1.9.4