Flutter Engine
The Flutter Engine
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 */
8
10#include "src/gpu/Swizzle.h"
12
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
25 fMinFilter = ~0U;
26 fMagFilter = ~0U;
27 fWrapS = ~0U;
28 fWrapT = ~0U;
29 fMinLOD = SK_ScalarNaN;
30 fMaxLOD = SK_ScalarNaN;
31 fMaxAniso = -1.f;
32 fBorderColorInvalid = true;
33}
34
36 // These are the OpenGL defaults.
37 : fBaseMipMapLevel(0), fMaxMipmapLevel(1000), fSwizzleIsRGBA(true) {}
38
40 fSwizzleIsRGBA = false;
41 fBaseMipMapLevel = ~0;
42 fMaxMipmapLevel = ~0;
43}
44
46 fSamplerOverriddenState.invalidate();
47 fNonsamplerState.invalidate();
48}
49
52 ResetTimestamp currTimestamp) {
53 if (samplerState) {
54 fSamplerOverriddenState = *samplerState;
55 }
56 fNonsamplerState = nonsamplerState;
57 fResetTimestamp = currTimestamp;
58}
59
61 uint32_t sampleCount,
62 uint32_t levelCount,
63 GrProtected isProtected) {
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}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
#define GR_GL_NEAREST_MIPMAP_LINEAR
Definition: GrGLDefines.h:622
#define GR_GL_LINEAR
Definition: GrGLDefines.h:615
#define GR_GL_REPEAT
Definition: GrGLDefines.h:688
GrGLSurfaceInfo GrGLTextureSpecToSurfaceInfo(const GrGLTextureSpec &glSpec, uint32_t sampleCount, uint32_t levelCount, GrProtected isProtected)
#define SK_ScalarNaN
Definition: SkScalar.h:28
void set(const SamplerOverriddenState *samplerState, const NonsamplerState &nonsamplerState, ResetTimestamp currTimestamp)
const NonsamplerState & nonsamplerState() const
Definition: GrGLTypesPriv.h:61
Protected
Definition: GpuTypes.h:61
GrGLenum fTarget
Definition: GrGLTypesPriv.h:96
GrGLenum fFormat
Definition: GrGLTypesPriv.h:97