Remove fConfig/fFormat union in GrTextureDesc

Review URL: http://codereview.appspot.com/5448116/


git-svn-id: http://skia.googlecode.com/svn/trunk@2806 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-12-06 14:46:34 +00:00
parent 0be5eb7533
commit 5bc34f04fe
6 changed files with 10 additions and 15 deletions

View File

@ -79,7 +79,7 @@ protected:
// use RT flag bit because in GL it makes the texture be bottom-up
desc.fFlags = i ? kRenderTarget_GrTextureFlagBit :
kNone_GrTextureFlags;
desc.fFormat = kSkia8888_PM_GrPixelConfig;
desc.fConfig = kSkia8888_PM_GrPixelConfig;
desc.fWidth = 2 * S;
desc.fHeight = 2 * S;
GrTexture* texture =

View File

@ -490,12 +490,7 @@ struct GrTextureDesc {
* Format of source data of the texture. Not guaraunteed to be the same as
* internal format used by 3D API.
*/
// This union exists because WebKit uses the deprecated name fFormat. Once
// WebKit has been changed fFormat will be dropped.
union {
GrPixelConfig fFormat;
GrPixelConfig fConfig;
};
GrPixelConfig fConfig;
};
/**

View File

@ -182,7 +182,7 @@ GrAtlas* GrAtlasMgr::addToAtlas(GrAtlas* atlas,
kNone_GrAALevel,
GR_ATLAS_TEXTURE_WIDTH,
GR_ATLAS_TEXTURE_HEIGHT,
{ maskformat2pixelconfig(format) }
maskformat2pixelconfig(format)
};
fTexture[format] = fGpu->createTexture(desc, NULL, 0);
if (NULL == fTexture[format]) {

View File

@ -1758,7 +1758,7 @@ bool GrContext::internalReadRenderTargetPixels(GrRenderTarget* target,
kRenderTarget_GrTextureFlagBit,
kNone_GrAALevel,
width, height,
{ config }
config
};
// When a full readback is faster than a partial we could always make
@ -1880,7 +1880,7 @@ void GrContext::internalWriteRenderTargetPixels(GrRenderTarget* target,
}
const GrTextureDesc desc = {
kNone_GrTextureFlags, kNone_GrAALevel, width, height, { config }
kNone_GrTextureFlags, kNone_GrAALevel, width, height, config
};
GrAutoScratchTexture ast(this, desc);
GrTexture* texture = ast.texture();

View File

@ -746,7 +746,7 @@ static GrTexture* gaussianBlur(GrContext* context, GrTexture* srcTexture,
kNone_GrAALevel,
srcRect.width(),
srcRect.height(),
{ kRGBA_8888_GrPixelConfig }
kRGBA_8888_GrPixelConfig
};
temp1->set(context, desc);
@ -886,7 +886,7 @@ static bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path,
srcRect.height(),
// We actually only need A8, but it often isn't supported as a
// render target
{ kRGBA_8888_PM_GrPixelConfig }
kRGBA_8888_PM_GrPixelConfig
};
GrAutoScratchTexture pathEntry(context, desc);
@ -1017,7 +1017,7 @@ static bool drawWithMaskFilter(GrContext* context, const SkPath& path,
kNone_GrAALevel,
dstM.fBounds.width(),
dstM.fBounds.height(),
{ kAlpha_8_GrPixelConfig }
kAlpha_8_GrPixelConfig
};
GrAutoScratchTexture ast(context, desc);
@ -1758,7 +1758,7 @@ SkGpuDevice::TexCache SkGpuDevice::lockCachedTexture(const SkBitmap& bitmap,
kNone_GrAALevel,
bitmap.width(),
bitmap.height(),
{ SkGr::Bitmap2PixelConfig(bitmap) }
SkGr::Bitmap2PixelConfig(bitmap)
};
GrContext::ScratchTexMatch match;
if (kSaveLayerDeviceRenderTarget_TexType == type) {

View File

@ -76,7 +76,7 @@ GrContext::TextureCacheEntry sk_gr_create_bitmap_texture(GrContext* ctx,
kNone_GrAALevel,
bitmap->width(),
bitmap->height(),
{ SkGr::Bitmap2PixelConfig(*bitmap) }
SkGr::Bitmap2PixelConfig(*bitmap)
};
if (SkBitmap::kIndex8_Config == bitmap->config()) {