Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 */
8
12#include "src/core/SkMipmap.h"
13struct SkImageInfo;
14
16 fMM = sk_sp<SkMipmap>(SkMipmap::Build({info, nullptr, 0},
17 /* factoryProc= */ nullptr,
18 /* computeContents= */ false));
19}
20
22
24 return fMM ? fMM->countLevels() : 0;
25}
26
28 SkPixmap pm;
29
31 if (fMM && fMM->getLevel(index, &level)) {
32 pm = level.fPixmap;
33 }
34 return pm;
35}
36
38 return src->withMipmaps(fMM);
39}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
int countLevels() const
sk_sp< SkImage > attachTo(const sk_sp< const SkImage > &src)
SkPixmap level(int index) const
SkMipmapBuilder(const SkImageInfo &)
static SkMipmap * Build(const SkPixmap &src, SkDiscardableFactoryProc, bool computeContents=true)
Definition SkMipmap.cpp:45
int countLevels() const
Definition SkMipmap.cpp:276
bool getLevel(int index, Level *) const
Definition SkMipmap.cpp:280