aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp62
-rw-r--r--src/gpu/gl/GrGLCaps.h1
-rw-r--r--src/gpu/gl/GrGLDefines.h120
-rw-r--r--src/gpu/gl/GrGLGpu.cpp36
-rw-r--r--src/gpu/gl/GrGLGpu.h22
-rw-r--r--src/gpu/gl/GrGLTexture.cpp27
6 files changed, 195 insertions, 73 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index a37d0e093f..ed3c38180e 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -863,6 +863,10 @@ bool GrGLCaps::readPixelsSupported(GrPixelConfig surfaceConfig,
return false;
}
+ if (GrPixelConfigIsSint(surfaceConfig) != GrPixelConfigIsSint(readConfig)) {
+ return false;
+ }
+
GrGLenum readFormat;
GrGLenum readType;
if (!this->getReadPixelsFormat(surfaceConfig, readConfig, &readFormat, &readType)) {
@@ -874,8 +878,11 @@ bool GrGLCaps::readPixelsSupported(GrPixelConfig surfaceConfig,
// the manual (https://www.opengl.org/sdk/docs/man/) says only these formats are allowed:
// GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL, GL_RED, GL_GREEN, GL_BLUE,
// GL_RGB, GL_BGR, GL_RGBA, and GL_BGRA. We check for the subset that we would use.
+ // The manual does not seem to fully match the spec as the spec allows integer formats
+ // when the bound color buffer is an integer buffer. It doesn't specify which integer
+ // formats are allowed, so perhaps all of them are. We only use GL_RGBA_INTEGER currently.
if (readFormat != GR_GL_RED && readFormat != GR_GL_RGB && readFormat != GR_GL_RGBA &&
- readFormat != GR_GL_BGRA) {
+ readFormat != GR_GL_BGRA && readFormat != GR_GL_RGBA_INTEGER) {
return false;
}
// There is also a set of allowed types, but all the types we use are in the set:
@@ -890,16 +897,22 @@ bool GrGLCaps::readPixelsSupported(GrPixelConfig surfaceConfig,
}
// See Section 16.1.2 in the ES 3.2 specification.
-
- if (kNormalizedFixedPoint_FormatType == fConfigTable[surfaceConfig].fFormatType) {
- if (GR_GL_RGBA == readFormat && GR_GL_UNSIGNED_BYTE == readType) {
- return true;
- }
- } else {
- SkASSERT(kFloat_FormatType == fConfigTable[surfaceConfig].fFormatType);
- if (GR_GL_RGBA == readFormat && GR_GL_FLOAT == readType) {
- return true;
- }
+ switch (fConfigTable[surfaceConfig].fFormatType) {
+ case kNormalizedFixedPoint_FormatType:
+ if (GR_GL_RGBA == readFormat && GR_GL_UNSIGNED_BYTE == readType) {
+ return true;
+ }
+ break;
+ case kInteger_FormatType:
+ if (GR_GL_RGBA_INTEGER == readFormat && GR_GL_INT == readType) {
+ return true;
+ }
+ break;
+ case kFloat_FormatType:
+ if (GR_GL_RGBA == readFormat && GR_GL_FLOAT == readType) {
+ return true;
+ }
+ break;
}
if (0 == fConfigTable[surfaceConfig].fSecondReadPixelsFormat.fFormat) {
@@ -1569,6 +1582,33 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa
}
fConfigTable[kSBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA();
+ bool hasIntegerTextures;
+ if (standard == kGL_GrGLStandard) {
+ hasIntegerTextures = version >= GR_GL_VER(3, 0) ||
+ ctxInfo.hasExtension("GL_EXT_texture_integer");
+ } else {
+ hasIntegerTextures = (version >= GR_GL_VER(3, 0));
+ }
+ // We may have limited GLSL to an earlier version that doesn't have integer sampler types.
+ if (ctxInfo.glslGeneration() == k110_GrGLSLGeneration) {
+ hasIntegerTextures = false;
+ }
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_RGBA_INTEGER;
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_RGBA8I;
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFormats.fExternalFormat[kOther_ExternalFormatUsage] = GR_GL_RGBA_INTEGER;
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFormats.fExternalType = GR_GL_BYTE;
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFormatType = kInteger_FormatType;
+ // We currently only support using integer textures as srcs, not for rendering (even though GL
+ // allows it).
+ if (hasIntegerTextures) {
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFlags = ConfigInfo::kTextureable_Flag |
+ ConfigInfo::kFBOColorAttachment_Flag;
+ if (texStorageSupported) {
+ fConfigTable[kRGBA_8888_sint_GrPixelConfig].fFlags |=
+ ConfigInfo::kCanUseTexStorage_Flag;
+ }
+ }
+
fConfigTable[kRGB_565_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_RGB;
if (this->ES2CompatibilitySupport()) {
fConfigTable[kRGB_565_GrPixelConfig].fFormats.fSizedInternalFormat = GR_GL_RGB565;
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index c2773231df..496635d766 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -425,6 +425,7 @@ private:
enum FormatType {
kNormalizedFixedPoint_FormatType,
kFloat_FormatType,
+ kInteger_FormatType,
};
struct ReadPixelsFormat {
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h
index 8dc7af1424..8f739cc1f6 100644
--- a/src/gpu/gl/GrGLDefines.h
+++ b/src/gpu/gl/GrGLDefines.h
@@ -408,24 +408,112 @@
#define GR_GL_LINE_WIDTH_GRANULARITY 0x0B23
#define GR_GL_LINE_WIDTH_RANGE 0x0B22
-/* PixelFormat */
+/* Unsized formats */
+#define GR_GL_STENCIL_INDEX 0x1901
#define GR_GL_DEPTH_COMPONENT 0x1902
+#define GR_GL_DEPTH_STENCIL 0x84F9
#define GR_GL_RED 0x1903
+#define GR_GL_RED_INTEGER 0x8D94
#define GR_GL_GREEN 0x1904
#define GR_GL_BLUE 0x1905
#define GR_GL_ALPHA 0x1906
+#define GR_GL_LUMINANCE 0x1909
+#define GR_GL_LUMINANCE_ALPHA 0x190A
+#define GR_GL_RG_INTEGER 0x8228
#define GR_GL_RGB 0x1907
+#define GR_GL_RGB_INTEGER 0x8D98
+#define GR_GL_SRGB 0x8C40
#define GR_GL_RGBA 0x1908
+#define GR_GL_SRGB_ALPHA 0x8C42
+#define GR_GL_RGBA_INTEGER 0x8D99
#define GR_GL_BGRA 0x80E1
-#define GR_GL_LUMINANCE 0x1909
-#define GR_GL_LUMINANCE_ALPHA 0x190A
-#define GR_GL_PALETTE8_RGBA8 0x8B96
-#define GR_GL_ALPHA8 0x803C
+/* Stencil index sized formats */
+#define GR_GL_STENCIL_INDEX4 0x8D47
+#define GR_GL_STENCIL_INDEX8 0x8D48
+#define GR_GL_STENCIL_INDEX16 0x8D49
+
+/* Depth component sized formats */
+#define GR_GL_DEPTH_COMPONENT16 0x81A5
+
+/* Depth stencil sized formats */
+#define GR_GL_DEPTH24_STENCIL8 0x88F0
+
+/* Red sized formats */
#define GR_GL_R8 0x8229
+#define GR_GL_R16 0x822A
#define GR_GL_R16F 0x822D
-#define GR_GL_RGBA16F 0x881A
+#define GR_GL_R32F 0x822E
+
+/* Red integer sized formats */
+#define GR_GL_R8I 0x8231
+#define GR_GL_R8UI 0x8232
+#define GR_GL_R16I 0x8233
+#define GR_GL_R16UI 0x8234
+#define GR_GL_R32I 0x8235
+#define GR_GL_R32UI 0x8236
+
+/* Alpha sized formats */
+#define GR_GL_ALPHA8 0x803C
+#define GR_GL_ALPHA16 0x803E
#define GR_GL_ALPHA16F 0x881C
+#define GR_GL_ALPHA32F 0x8816
+
+/* Alpha integer sized formats */
+#define GR_GL_ALPHA8I 0x8D90
+#define GR_GL_ALPHA8UI 0x8D7E
+#define GR_GL_ALPHA16I 0x8D8A
+#define GR_GL_ALPHA16UI 0x8D78
+#define GR_GL_ALPHA32I 0x8D84
+#define GR_GL_ALPHA32UI 0x8D72
+
+/* RG sized formats */
+#define GR_GL_RG8 0x822B
+#define GR_GL_RG16 0x822C
+#define GR_GL_R16F 0x822D
+#define GR_GL_R32F 0x822E
+
+/* RG sized integer formats */
+#define GR_GL_RG8I 0x8237
+#define GR_GL_RG8UI 0x8238
+#define GR_GL_RG16I 0x8239
+#define GR_GL_RG16UI 0x823A
+#define GR_GL_RG32I 0x823B
+#define GR_GL_RG32UI 0x823C
+
+/* RGB sized formats */
+#define GR_GL_RGB5 0x8050
+#define GR_GL_RGB565 0x8D62
+#define GR_GL_RGB8 0x8051
+#define GR_GL_SRGB8 0x8C41
+
+/* RGB integer sized formats */
+#define GR_GL_RGB8I 0x8D8F
+#define GR_GL_RGB8UI 0x8D7D
+#define GR_GL_RGB16I 0x8D89
+#define GR_GL_RGB16UI 0x8D77
+#define GR_GL_RGB32I 0x8D83
+#define GR_GL_RGB32UI 0x8D71
+
+/* RGBA sized formats */
+#define GR_GL_RGBA4 0x8056
+#define GR_GL_RGB5_A1 0x8057
+#define GR_GL_PALETTE8_RGBA8 0x8B96
+#define GR_GL_RGBA8 0x8058
+#define GR_GL_SRGB8_ALPHA8 0x8C43
+#define GR_GL_RGBA16F 0x881A
+#define GR_GL_RGBA32F 0x8814
+
+/* RGBA integer sized formats */
+#define GR_GL_RGBA8I 0x8D8E
+#define GR_GL_RGBA8UI 0x8D7C
+#define GR_GL_RGBA16I 0x8D88
+#define GR_GL_RGBA16UI 0x8D76
+#define GR_GL_RGBA32I 0x8D82
+#define GR_GL_RGBA32UI 0x8D70
+
+/* BGRA sized formats */
+#define GR_GL_BGRA8 0x93A1
/* PixelType */
/* GL_UNSIGNED_BYTE */
@@ -782,26 +870,6 @@
#define GR_GL_RENDERBUFFER 0x8D41
-#define GR_GL_RGBA4 0x8056
-#define GR_GL_RGB5_A1 0x8057
-#define GR_GL_RGB565 0x8D62
-#define GR_GL_RGBA8 0x8058
-#define GR_GL_RGBA32F 0x8814
-#define GR_GL_RGB5 0x8050
-#define GR_GL_RGB8 0x8051
-#define GR_GL_BGRA8 0x93A1
-#define GR_GL_SRGB 0x8C40
-#define GR_GL_SRGB8 0x8C41
-#define GR_GL_SRGB_ALPHA 0x8C42
-#define GR_GL_SRGB8_ALPHA8 0x8C43
-#define GR_GL_DEPTH_COMPONENT16 0x81A5
-#define GR_GL_STENCIL_INDEX 0x1901
-#define GR_GL_STENCIL_INDEX4 0x8D47
-#define GR_GL_STENCIL_INDEX8 0x8D48
-#define GR_GL_STENCIL_INDEX16 0x8D49
-#define GR_GL_DEPTH_STENCIL 0x84F9
-#define GR_GL_DEPTH24_STENCIL8 0x88F0
-
#define GR_GL_MAX_SAMPLES 0x8D57
// GL_IMG_multisampled_render_to_texture uses a different value for GL_MAX_SAMPLES
#define GR_GL_MAX_SAMPLES_IMG 0x9135
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 9ccd073fe7..63f0c28e4b 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -922,6 +922,7 @@ static inline GrGLint config_alignment(GrPixelConfig config) {
case kBGRA_8888_GrPixelConfig:
case kSRGBA_8888_GrPixelConfig:
case kSBGRA_8888_GrPixelConfig:
+ case kRGBA_8888_sint_GrPixelConfig:
case kRGBA_float_GrPixelConfig:
return 4;
default:
@@ -971,14 +972,14 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc
// This means if we may later want to add mipmaps, we cannot use TexStorage.
// Right now, we cannot know if we will later add mipmaps or not.
// The only time we can use TexStorage is when we already have the
- // mipmaps.
- useTexStorage &= texels.count() > 1;
+ // mipmaps or are using a format incompatible with MIP maps.
+ useTexStorage &= texels.count() > 1 || GrPixelConfigIsSint(desc.fConfig);
if (useTexStorage) {
// We never resize or change formats of textures.
GL_ALLOC_CALL(&interface,
TexStorage2D(target,
- texels.count(),
+ SkTMax(texels.count(), 1),
internalFormatForTexStorage,
desc.fWidth, desc.fHeight));
GrGLenum error = check_alloc_error(desc, &interface);
@@ -3488,6 +3489,9 @@ static inline bool can_blit_framebuffer_for_copy_surface(const GrSurface* dst,
!gpu->glCaps().canConfigBeFBOColorAttachment(src->config())) {
return false;
}
+ // Blits are not allowed between int color buffers and float/fixed color buffers. GrGpu should
+ // have filtered such cases out.
+ SkASSERT(GrPixelConfigIsSint(dst->config()) == GrPixelConfigIsSint(src->config()));
const GrGLTexture* dstTex = static_cast<const GrGLTexture*>(dst->asTexture());
const GrGLTexture* srcTex = static_cast<const GrGLTexture*>(dst->asTexture());
const GrRenderTarget* dstRT = dst->asRenderTarget();
@@ -3723,19 +3727,10 @@ bool GrGLGpu::onCopySurface(GrSurface* dst,
return false;
}
-bool GrGLGpu::createCopyProgram(int progIdx) {
+bool GrGLGpu::createCopyProgram(GrTexture* srcTex) {
+ int progIdx = TextureToCopyProgramIdx(srcTex);
const GrGLSLCaps* glslCaps = this->glCaps().glslCaps();
- static const GrSLType kSamplerTypes[3] = { kTexture2DSampler_GrSLType,
- kTextureExternalSampler_GrSLType,
- kTexture2DRectSampler_GrSLType };
- if (kTextureExternalSampler_GrSLType == kSamplerTypes[progIdx] &&
- !this->glCaps().glslCaps()->externalTextureSupport()) {
- return false;
- }
- if (kTexture2DRectSampler_GrSLType == kSamplerTypes[progIdx] &&
- !this->glCaps().rectangleTextureSupport()) {
- return false;
- }
+ GrSLType samplerType = srcTex->texturePriv().samplerType();
if (!fCopyProgramArrayBuffer) {
static const GrGLfloat vdata[] = {
@@ -3763,7 +3758,7 @@ bool GrGLGpu::createCopyProgram(int progIdx) {
GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar uPosXform("u_posXform", kVec4f_GrSLType,
GrShaderVar::kUniform_TypeModifier);
- GrGLSLShaderVar uTexture("u_texture", kSamplerTypes[progIdx],
+ GrGLSLShaderVar uTexture("u_texture", samplerType,
GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType,
GrShaderVar::kVaryingOut_TypeModifier);
@@ -3802,7 +3797,7 @@ bool GrGLGpu::createCopyProgram(int progIdx) {
fshaderTxt.appendf("#extension %s : require\n", extension);
}
}
- if (kSamplerTypes[progIdx] == kTextureExternalSampler_GrSLType) {
+ if (samplerType == kTextureExternalSampler_GrSLType) {
fshaderTxt.appendf("#extension %s : require\n",
glslCaps->externalTextureExtensionString());
}
@@ -3818,7 +3813,7 @@ bool GrGLGpu::createCopyProgram(int progIdx) {
"void main() {"
" sk_FragColor = %s(u_texture, v_texCoord);"
"}",
- GrGLSLTexture2DFunctionName(kVec2f_GrSLType, kSamplerTypes[progIdx], this->glslGeneration())
+ GrGLSLTexture2DFunctionName(kVec2f_GrSLType, samplerType, this->glslGeneration())
);
const char* str;
@@ -4170,10 +4165,10 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
GrGLTexture* srcTex = static_cast<GrGLTexture*>(src->asTexture());
- int progIdx = TextureTargetToCopyProgramIdx(srcTex->target());
+ int progIdx = TextureToCopyProgramIdx(srcTex);
if (!fCopyPrograms[progIdx].fProgram) {
- if (!this->createCopyProgram(progIdx)) {
+ if (!this->createCopyProgram(srcTex)) {
SkDebugf("Failed to create copy program.\n");
return false;
}
@@ -4359,6 +4354,7 @@ bool GrGLGpu::copySurfaceAsBlitFramebuffer(GrSurface* dst,
// Uses draw calls to do a series of downsample operations to successive mips.
// If this returns false, then the calling code falls back to using glGenerateMipmap.
bool GrGLGpu::generateMipmap(GrGLTexture* texture, bool gammaCorrect) {
+ SkASSERT(!GrPixelConfigIsSint(texture->config()));
// Our iterative downsample requires the ability to limit which level we're sampling:
if (!this->glCaps().doManualMipmapping()) {
return false;
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 32ce979c96..0c9d3731be 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -17,7 +17,7 @@
#include "GrGLTexture.h"
#include "GrGLVertexArray.h"
#include "GrGpu.h"
-#include "GrTypes.h"
+#include "GrTexturePriv.h"
#include "GrWindowRectsState.h"
#include "GrXferProcessor.h"
#include "SkTArray.h"
@@ -395,7 +395,7 @@ private:
sk_sp<GrGLContext> fGLContext;
- bool createCopyProgram(int progIdx);
+ bool createCopyProgram(GrTexture* srcTexture);
bool createMipmapProgram(int progIdx);
bool createWireRectProgram();
bool createPLSSetupProgram();
@@ -589,13 +589,13 @@ private:
int fHWNumRasterSamples;
///@}
- /** IDs for copy surface program. */
+ /** IDs for copy surface program. (4 sampler types) */
struct {
GrGLuint fProgram;
GrGLint fTextureUniform;
GrGLint fTexCoordXformUniform;
GrGLint fPosXformUniform;
- } fCopyPrograms[3];
+ } fCopyPrograms[4];
sk_sp<GrGLBuffer> fCopyProgramArrayBuffer;
/** IDs for texture mipmap program. (4 filter configurations) */
@@ -613,16 +613,18 @@ private:
} fWireRectProgram;
sk_sp<GrGLBuffer> fWireRectArrayBuffer;
- static int TextureTargetToCopyProgramIdx(GrGLenum target) {
- switch (target) {
- case GR_GL_TEXTURE_2D:
+ static int TextureToCopyProgramIdx(GrTexture* texture) {
+ switch (texture->texturePriv().samplerType()) {
+ case kTexture2DSampler_GrSLType:
return 0;
- case GR_GL_TEXTURE_EXTERNAL:
+ case kTexture2DISampler_GrSLType:
return 1;
- case GR_GL_TEXTURE_RECTANGLE:
+ case kTexture2DRectSampler_GrSLType:
return 2;
+ case kTextureExternalSampler_GrSLType:
+ return 3;
default:
- SkFAIL("Unexpected texture target type.");
+ SkFAIL("Unexpected samper type");
return 0;
}
}
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index c45d08f93c..9f213fbc83 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -12,20 +12,31 @@
#define GPUGL static_cast<GrGLGpu*>(this->getGpu())
#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
-static inline GrSLType sampler_type(const GrGLTexture::IDDesc& idDesc, const GrGLGpu* gpu) {
+static inline GrSLType sampler_type(const GrGLTexture::IDDesc& idDesc, GrPixelConfig config,
+ const GrGLGpu* gpu) {
if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
SkASSERT(gpu->glCaps().glslCaps()->externalTextureSupport());
+ SkASSERT(!GrPixelConfigIsSint(config));
return kTextureExternalSampler_GrSLType;
} else if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE) {
SkASSERT(gpu->glCaps().rectangleTextureSupport());
+ SkASSERT(!GrPixelConfigIsSint(config));
return kTexture2DRectSampler_GrSLType;
+ } else if (GrPixelConfigIsSint(config)) {
+ return kTexture2DISampler_GrSLType;
} else {
SkASSERT(idDesc.fInfo.fTarget == GR_GL_TEXTURE_2D);
return kTexture2DSampler_GrSLType;
}
}
-static inline GrTextureParams::FilterMode highest_filter_mode(const GrGLTexture::IDDesc& idDesc) {
+static inline GrTextureParams::FilterMode highest_filter_mode(const GrGLTexture::IDDesc& idDesc,
+ GrPixelConfig config) {
+ if (GrPixelConfigIsSint(config)) {
+ // Integer textures in GL can use GL_NEAREST_MIPMAP_NEAREST. This is a mode we don't support
+ // and don't currently have a use for.
+ return GrTextureParams::kNone_FilterMode;
+ }
if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE ||
idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
return GrTextureParams::kBilerp_FilterMode;
@@ -37,7 +48,8 @@ static inline GrTextureParams::FilterMode highest_filter_mode(const GrGLTexture:
GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
const IDDesc& idDesc)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, sampler_type(idDesc, gpu), highest_filter_mode(idDesc), false) {
+ , INHERITED(gpu, desc, sampler_type(idDesc, desc.fConfig, gpu),
+ highest_filter_mode(idDesc, desc.fConfig), false) {
this->init(desc, idDesc);
this->registerWithCache(budgeted);
}
@@ -46,7 +58,8 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc&
const IDDesc& idDesc,
bool wasMipMapDataProvided)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, sampler_type(idDesc, gpu), highest_filter_mode(idDesc),
+ , INHERITED(gpu, desc, sampler_type(idDesc, desc.fConfig, gpu),
+ highest_filter_mode(idDesc, desc.fConfig),
wasMipMapDataProvided) {
this->init(desc, idDesc);
this->registerWithCache(budgeted);
@@ -54,7 +67,8 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc&
GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc, const IDDesc& idDesc)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, sampler_type(idDesc, gpu), highest_filter_mode(idDesc), false) {
+ , INHERITED(gpu, desc, sampler_type(idDesc, desc.fConfig, gpu),
+ highest_filter_mode(idDesc, desc.fConfig), false) {
this->init(desc, idDesc);
this->registerWithCacheWrapped();
}
@@ -62,7 +76,8 @@ GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc, const
GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc,
bool wasMipMapDataProvided)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, sampler_type(idDesc, gpu), highest_filter_mode(idDesc),
+ , INHERITED(gpu, desc, sampler_type(idDesc, desc.fConfig, gpu),
+ highest_filter_mode(idDesc, desc.fConfig),
wasMipMapDataProvided) {
this->init(desc, idDesc);
}