aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-14 15:03:35 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-14 15:03:35 +0000
commit8afae61a57f87e4a50578effce6c428031499301 (patch)
treeba9a4d4497a0416b932b384502e3b519af57e3a1 /bench
parent9ed02b9da25a76ee4c73c1ab19c18b899a223a17 (diff)
Clean up most clang warnings outside animator/
Diffstat (limited to 'bench')
-rw-r--r--bench/ShaderMaskBench.cpp2
-rw-r--r--bench/benchmain.cpp44
2 files changed, 22 insertions, 24 deletions
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<GrPlatform3DContext>(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<GrPlatform3DContext>(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;
}