From 5bc34f04fe70cdde702ac3bff1fea0ccb275d4a5 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 6 Dec 2011 14:46:34 +0000 Subject: [PATCH] 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 --- gm/texdata.cpp | 2 +- include/gpu/GrTypes.h | 7 +------ src/gpu/GrAtlas.cpp | 2 +- src/gpu/GrContext.cpp | 4 ++-- src/gpu/SkGpuDevice.cpp | 8 ++++---- src/gpu/SkGr.cpp | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/gm/texdata.cpp b/gm/texdata.cpp index d3cc83c65..0b5cb33a6 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -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 = diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index e961fac80..0bcab7d8a 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -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; }; /** diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp index 5c951536b..17464ba57 100644 --- a/src/gpu/GrAtlas.cpp +++ b/src/gpu/GrAtlas.cpp @@ -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]) { diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index e4b115082..9f82a15e6 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -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(); diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 54965a677..02a83f20a 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -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) { diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index e76ec5db6..761a46b23 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -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()) {