Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
gl
GrGLTypesPriv.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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/gpu/ganesh/gl/GrGLTypesPriv.h
"
8
9
#include "
include/core/SkScalar.h
"
10
#include "
src/gpu/Swizzle.h
"
11
#include "
src/gpu/ganesh/gl/GrGLDefines.h
"
12
13
GrGLTextureParameters::SamplerOverriddenState::SamplerOverriddenState
()
14
// These are the OpenGL defaults.
15
: fMinFilter(
GR_GL_NEAREST_MIPMAP_LINEAR
)
16
, fMagFilter(
GR_GL_LINEAR
)
17
, fWrapS(
GR_GL_REPEAT
)
18
, fWrapT(
GR_GL_REPEAT
)
19
, fMinLOD(-1000.f)
20
, fMaxLOD(1000.f)
21
, fMaxAniso(1.f)
22
, fBorderColorInvalid(
false
) {}
23
24
void
GrGLTextureParameters::SamplerOverriddenState::invalidate
() {
25
fMinFilter = ~0
U
;
26
fMagFilter = ~0
U
;
27
fWrapS = ~0
U
;
28
fWrapT = ~0
U
;
29
fMinLOD =
SK_ScalarNaN
;
30
fMaxLOD =
SK_ScalarNaN
;
31
fMaxAniso = -1.f;
32
fBorderColorInvalid =
true
;
33
}
34
35
GrGLTextureParameters::NonsamplerState::NonsamplerState
()
36
// These are the OpenGL defaults.
37
: fBaseMipMapLevel(0), fMaxMipmapLevel(1000), fSwizzleIsRGBA(
true
) {}
38
39
void
GrGLTextureParameters::NonsamplerState::invalidate
() {
40
fSwizzleIsRGBA =
false
;
41
fBaseMipMapLevel = ~0;
42
fMaxMipmapLevel = ~0;
43
}
44
45
void
GrGLTextureParameters::invalidate
() {
46
fSamplerOverriddenState.
invalidate
();
47
fNonsamplerState.
invalidate
();
48
}
49
50
void
GrGLTextureParameters::set
(
const
SamplerOverriddenState
* samplerState,
51
const
NonsamplerState
&
nonsamplerState
,
52
ResetTimestamp
currTimestamp) {
53
if
(samplerState) {
54
fSamplerOverriddenState = *samplerState;
55
}
56
fNonsamplerState =
nonsamplerState
;
57
fResetTimestamp = currTimestamp;
58
}
59
60
GrGLSurfaceInfo
GrGLTextureSpecToSurfaceInfo
(
const
GrGLTextureSpec
& glSpec,
61
uint32_t sampleCount,
62
uint32_t levelCount,
63
GrProtected
isProtected) {
64
GrGLSurfaceInfo
info
;
65
// Shared info
66
info
.fSampleCount = sampleCount;
67
info
.fLevelCount = levelCount;
68
info
.fProtected = isProtected;
69
70
// GL info
71
info
.fTarget = glSpec.
fTarget
;
72
info
.fFormat = glSpec.
fFormat
;
73
74
return
info
;
75
}
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
GrGLDefines.h
GR_GL_NEAREST_MIPMAP_LINEAR
#define GR_GL_NEAREST_MIPMAP_LINEAR
Definition:
GrGLDefines.h:622
GR_GL_LINEAR
#define GR_GL_LINEAR
Definition:
GrGLDefines.h:615
GR_GL_REPEAT
#define GR_GL_REPEAT
Definition:
GrGLDefines.h:688
GrGLTextureSpecToSurfaceInfo
GrGLSurfaceInfo GrGLTextureSpecToSurfaceInfo(const GrGLTextureSpec &glSpec, uint32_t sampleCount, uint32_t levelCount, GrProtected isProtected)
Definition:
GrGLTypesPriv.cpp:60
GrGLTypesPriv.h
SkScalar.h
SK_ScalarNaN
#define SK_ScalarNaN
Definition:
SkScalar.h:28
Swizzle.h
GrGLTextureParameters::invalidate
void invalidate()
Definition:
GrGLTypesPriv.cpp:45
GrGLTextureParameters::set
void set(const SamplerOverriddenState *samplerState, const NonsamplerState &nonsamplerState, ResetTimestamp currTimestamp)
Definition:
GrGLTypesPriv.cpp:50
GrGLTextureParameters::ResetTimestamp
uint64_t ResetTimestamp
Definition:
GrGLTypesPriv.h:24
GrGLTextureParameters::nonsamplerState
const NonsamplerState & nonsamplerState() const
Definition:
GrGLTypesPriv.h:61
dart::compiler::U
@ U
Definition:
assembler_arm.h:71
dart::false
false
Definition:
isolate_reload.cc:58
skgpu::Protected
Protected
Definition:
GpuTypes.h:61
GrGLSurfaceInfo
Definition:
GrGLTypes.h:210
GrGLTextureParameters::NonsamplerState
Definition:
GrGLTypesPriv.h:48
GrGLTextureParameters::NonsamplerState::NonsamplerState
NonsamplerState()
Definition:
GrGLTypesPriv.cpp:35
GrGLTextureParameters::NonsamplerState::invalidate
void invalidate()
Definition:
GrGLTypesPriv.cpp:39
GrGLTextureParameters::SamplerOverriddenState
Definition:
GrGLTypesPriv.h:31
GrGLTextureParameters::SamplerOverriddenState::invalidate
void invalidate()
Definition:
GrGLTypesPriv.cpp:24
GrGLTextureParameters::SamplerOverriddenState::SamplerOverriddenState
SamplerOverriddenState()
Definition:
GrGLTypesPriv.cpp:13
GrGLTextureSpec
Definition:
GrGLTypesPriv.h:92
GrGLTextureSpec::fTarget
GrGLenum fTarget
Definition:
GrGLTypesPriv.h:96
GrGLTextureSpec::fFormat
GrGLenum fFormat
Definition:
GrGLTypesPriv.h:97
true
true
Definition:
verylargebitmap.cpp:163
Generated on Sun Jun 23 2024 21:56:19 for Flutter Engine by
1.9.4