From 8afae61a57f87e4a50578effce6c428031499301 Mon Sep 17 00:00:00 2001 From: "tomhudson@google.com" Date: Tue, 14 Aug 2012 15:03:35 +0000 Subject: Clean up most clang warnings outside animator/ http://codereview.appspot.com/6464058/ git-svn-id: http://skia.googlecode.com/svn/trunk@5079 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/ShaderMaskBench.cpp | 2 +- bench/benchmain.cpp | 44 +++++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 24 deletions(-) (limited to 'bench') diff --git a/bench/ShaderMaskBench.cpp b/bench/ShaderMaskBench.cpp index bd31075797..0a68b44303 100644 --- a/bench/ShaderMaskBench.cpp +++ b/bench/ShaderMaskBench.cpp @@ -51,7 +51,7 @@ public: protected: virtual const char* onGetName() { - fName.printf("shadermask", SkScalarToFloat(fPaint.getTextSize())); + fName.printf("shadermask"); fName.appendf("_%s", fontQualityName(fPaint)); fName.appendf("_%02X", fPaint.getAlpha()); return fName.c_str(); diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp index fa43155da9..a91d348828 100644 --- a/bench/benchmain.cpp +++ b/bench/benchmain.cpp @@ -242,31 +242,29 @@ public: bool init(SkGLContext* glCtx, int width, int height) { GrContext* grCtx; - GrRenderTarget* rt; - if (glCtx->init(width, height)) { - GrPlatform3DContext ctx = - reinterpret_cast(glCtx->gl()); - grCtx = GrContext::Create(kOpenGL_Shaders_GrEngine, ctx); - if (NULL != grCtx) { - GrPlatformRenderTargetDesc desc; - desc.fConfig = kSkia8888_PM_GrPixelConfig; - desc.fWidth = width; - desc.fHeight = height; - desc.fStencilBits = 8; - desc.fRenderTargetHandle = glCtx->getFBOID(); - rt = grCtx->createPlatformRenderTarget(desc); - if (NULL == rt) { - grCtx->unref(); - return false; - } - } - } else { + if (!glCtx->init(width, height)) { return false; } - glCtx->ref(); - fGLContext.reset(glCtx); - fGrContext.reset(grCtx); - fRenderTarget.reset(rt); + GrPlatform3DContext ctx = + reinterpret_cast(glCtx->gl()); + grCtx = GrContext::Create(kOpenGL_Shaders_GrEngine, ctx); + if (NULL != grCtx) { + GrPlatformRenderTargetDesc desc; + desc.fConfig = kSkia8888_PM_GrPixelConfig; + desc.fWidth = width; + desc.fHeight = height; + desc.fStencilBits = 8; + desc.fRenderTargetHandle = glCtx->getFBOID(); + GrRenderTarget* rt = grCtx->createPlatformRenderTarget(desc); + if (NULL == rt) { + grCtx->unref(); + return false; + } + glCtx->ref(); + fGLContext.reset(glCtx); + fGrContext.reset(grCtx); + fRenderTarget.reset(rt); + } return true; } -- cgit v1.2.3