// no longer need to clamp at min RT size.
rtDesc.fWidth = GrNextPow2(desc.fWidth);
rtDesc.fHeight = GrNextPow2(desc.fHeight);
- int bpp = GrBytesPerPixel(desc.fFormat);
+ int bpp = GrBytesPerPixel(desc.fConfig);
SkAutoSMalloc<128*128*4> stretchedPixels(bpp *
rtDesc.fWidth *
rtDesc.fHeight);
// we create a key of from the descriptor.
GrContext::TextureKey descKey = desc.fAALevel |
(desc.fFlags << 8) |
- ((uint64_t) desc.fFormat << 32);
+ ((uint64_t) desc.fConfig << 32);
// this code path isn't friendly to tiling with NPOT restricitons
// We just pass ClampNoFilter()
gen_texture_key_values(gpu, GrSamplerState::ClampNoFilter(), descKey,
desc.fHeight = GrMax(MIN_SIZE, GrNextPow2(desc.fHeight));
}
- uint32_t p0 = desc.fFormat;
+ uint32_t p0 = desc.fConfig;
uint32_t p1 = (desc.fAALevel << 16) | desc.fFlags;
GrResourceEntry* entry;
kNoStencil_GrTextureFlagBit;
}
- desc.fFormat = kRGBA_8888_GrPixelConfig;
+ desc.fConfig = kRGBA_8888_GrPixelConfig;
if (PREFER_MSAA_OFFSCREEN_AA && fGpu->getCaps().fFSAASupport) {
record->fDownsample = OffscreenRecord::kFSAA_Downsample;
texDesc.fAllocWidth = texDesc.fContentWidth = desc.fWidth;
texDesc.fAllocHeight = texDesc.fContentHeight = desc.fHeight;
- texDesc.fFormat = desc.fConfig;
+ texDesc.fConfig = desc.fConfig;
texDesc.fOrientation = GrGLTexture::kBottomUp_Orientation;
texDesc.fTextureID = desc.fPlatformTexture;
texDesc.fOwnsID = false;
size_t rowBytes) {
// we assume the texture is bound
- size_t bpp = GrBytesPerPixel(desc.fFormat);
- size_t trimRowBytes = desc.fContentWidth * desc.fUploadByteCount;
+ size_t bpp = GrBytesPerPixel(desc.fConfig);
+ size_t trimRowBytes = desc.fContentWidth * bpp;
if (!rowBytes) {
rowBytes = trimRowBytes;
}
GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, static_cast<GrGLint>(bpp)));
- if (kIndex_8_GrPixelConfig == desc.fFormat &&
+ if (kIndex_8_GrPixelConfig == desc.fConfig &&
this->getCaps().f8BitPaletteSupport) {
// ES only supports CompressedTexImage2D, not CompressedTexSubimage2D
GrAssert(desc.fContentWidth == desc.fAllocWidth);
desc.fContentHeight * rowBytes - bpp;
uint8_t* extraTexel = (uint8_t*)texels.get();
for (int i = 0; i < extraW*extraH; ++i) {
- memcpy(extraTexel, cornerTexel, desc.fUploadByteCount);
+ memcpy(extraTexel, cornerTexel, bpp);
extraTexel += bpp;
}
GL_CALL(TexSubImage2D(GR_GL_TEXTURE_2D, 0, desc.fContentWidth,
glTexDesc.fContentHeight = desc.fHeight;
glTexDesc.fAllocWidth = desc.fWidth;
glTexDesc.fAllocHeight = desc.fHeight;
- glTexDesc.fFormat = desc.fFormat;
+ glTexDesc.fConfig = desc.fConfig;
glTexDesc.fOwnsID = true;
glRTDesc.fMSColorRenderbufferID = 0;
glRTDesc.fRTFBOID = 0;
glRTDesc.fTexFBOID = 0;
glRTDesc.fOwnIDs = true;
- glRTDesc.fConfig = glTexDesc.fFormat;
+ glRTDesc.fConfig = glTexDesc.fConfig;
bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit);
- if (!canBeTexture(desc.fFormat,
+ if (!canBeTexture(desc.fConfig,
&internalFormat,
&glTexDesc.fUploadFormat,
&glTexDesc.fUploadType)) {
GrPrintf("AA RT requested but not supported on this platform.");
}
- glTexDesc.fUploadByteCount = GrBytesPerPixel(desc.fFormat);
-
if (renderTarget) {
if (!caps.fNPOTRenderTargetSupport) {
glTexDesc.fAllocWidth = GrNextPow2(desc.fWidth);
tex = new GrGLTexture(this, glTexDesc, DEFAULT_PARAMS);
}
#ifdef TRACE_TEXTURE_CREATION
- GrPrintf("--- new texture [%d] size=(%d %d) bpp=%d\n",
- tex->fTextureID, width, height, tex->fUploadByteCount);
+ GrPrintf("--- new texture [%d] size=(%d %d) config=%d\n",
+ glTexDesc.fTextureID, desc.fWidth, desc.fHeight, desc.fConfig);
#endif
return tex;
}