Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
core
SkMipmapAccessor.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015 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 SkMipmapAccessor_DEFINED
9
#define SkMipmapAccessor_DEFINED
10
11
#include "
include/core/SkBitmap.h
"
12
#include "
include/core/SkMatrix.h
"
13
#include "
include/core/SkPixmap.h
"
14
#include "
include/core/SkRefCnt.h
"
15
#include "
include/private/base/SkAssert.h
"
16
#include "
include/private/base/SkNoncopyable.h
"
17
#include "
src/core/SkMipmap.h
"
18
19
#include <utility>
20
21
class
SkArenaAlloc
;
22
class
SkImage
;
23
class
SkImage_Base
;
24
enum class
SkMipmapMode
;
25
26
class
SkMipmapAccessor
:
::SkNoncopyable
{
27
public
:
28
// Returns null on failure
29
static
SkMipmapAccessor
*
Make
(
SkArenaAlloc
*,
const
SkImage
*,
const
SkMatrix
&
inv
,
SkMipmapMode
);
30
31
std::pair<SkPixmap, SkMatrix>
level
()
const
{
32
SkASSERT
(fUpper.
addr
() !=
nullptr
);
33
return
std::make_pair(fUpper, fUpperInv);
34
}
35
36
std::pair<SkPixmap, SkMatrix>
lowerLevel
()
const
{
37
SkASSERT
(fLower.
addr
() !=
nullptr
);
38
return
std::make_pair(fLower, fLowerInv);
39
}
40
41
// 0....1. Will be 0 if there is no lowerLevel
42
float
lowerWeight
()
const
{
return
fLowerWeight; }
43
44
private
:
45
SkPixmap
fUpper,
46
fLower;
// only valid for mip_linear
47
float
fLowerWeight;
// lower * weight + upper * (1 - weight)
48
SkMatrix
fUpperInv,
49
fLowerInv;
50
51
// these manage lifetime for the buffers
52
SkBitmap
fBaseStorage;
53
sk_sp<const SkMipmap>
fCurrMip;
54
55
public
:
56
// Don't call publicly -- this is only public for SkArenaAlloc to access it inside Make()
57
SkMipmapAccessor
(
const
SkImage_Base
*,
const
SkMatrix
&
inv
,
SkMipmapMode
requestedMode);
58
};
59
60
#endif
inv
static SkM44 inv(const SkM44 &m)
Definition
3d.cpp:26
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition
SkAssert.h:116
SkBitmap.h
SkMatrix.h
SkMipmap.h
SkNoncopyable.h
SkPixmap.h
SkRefCnt.h
SkMipmapMode
SkMipmapMode
Definition
SkSamplingOptions.h:24
SkArenaAlloc
Definition
SkArenaAlloc.h:105
SkBitmap
Definition
SkBitmap.h:59
SkImage_Base
Definition
SkImage_Base.h:38
SkImage
Definition
SkImage.h:272
SkMatrix
Definition
SkMatrix.h:54
SkMipmapAccessor
Definition
SkMipmapAccessor.h:26
SkMipmapAccessor::lowerWeight
float lowerWeight() const
Definition
SkMipmapAccessor.h:42
SkMipmapAccessor::Make
static SkMipmapAccessor * Make(SkArenaAlloc *, const SkImage *, const SkMatrix &inv, SkMipmapMode)
Definition
SkMipmapAccessor.cpp:111
SkMipmapAccessor::lowerLevel
std::pair< SkPixmap, SkMatrix > lowerLevel() const
Definition
SkMipmapAccessor.h:36
SkMipmapAccessor::level
std::pair< SkPixmap, SkMatrix > level() const
Definition
SkMipmapAccessor.h:31
SkNoncopyable
Definition
SkNoncopyable.h:18
SkPixmap
Definition
SkPixmap.h:40
SkPixmap::addr
const void * addr() const
Definition
SkPixmap.h:153
sk_sp
Definition
SkRefCnt.h:220
Generated on Fri Apr 26 2024 06:16:44 for Flutter Engine by
1.9.8