Fix some linux build warnings

Review URL: https://codereview.appspot.com/6571050

git-svn-id: http://skia.googlecode.com/svn/trunk@5675 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2012-09-25 19:55:07 +00:00
parent 2e91d7adb7
commit ccaa002dd8
4 changed files with 10 additions and 3 deletions

View File

@ -1388,10 +1388,13 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
}
// Perform any conversions we weren't able to perfom using a scratch texture.
if (unpremul || swapRAndB || flipY) {
SkCanvas::Config8888 srcC8888;
SkCanvas::Config8888 dstC8888;
// These are initialized to suppress a warning
SkCanvas::Config8888 srcC8888 = SkCanvas::kNative_Premul_Config8888;
SkCanvas::Config8888 dstC8888 = SkCanvas::kNative_Premul_Config8888;
bool c8888IsValid = grconfig_to_config8888(config, false, &srcC8888);
grconfig_to_config8888(config, unpremul, &dstC8888);
if (swapRAndB) {
GrAssert(c8888IsValid); // we should only do r/b swap on 8888 configs
srcC8888 = swap_config8888_red_and_blue(srcC8888);

View File

@ -300,6 +300,7 @@ GrPixelConfig config8888_to_grconfig_and_flags(SkCanvas::Config8888 config8888,
return kRGBA_8888_GrPixelConfig;
default:
GrCrash("Unexpected Config8888.");
*flags = 0; // suppress warning
return kSkia8888_PM_GrPixelConfig;
}
}

View File

@ -93,6 +93,9 @@ SkPMColor convertConfig8888ToPMColor(SkCanvas::Config8888 config8888,
g = static_cast<U8CPU>(c[1]);
b = static_cast<U8CPU>(c[2]);
break;
default:
SkDEBUGFAIL("Unexpected Config8888");
return 0;
}
if (*premul) {
r = SkMulDiv255Ceiling(r, a);

View File

@ -190,7 +190,7 @@ SkPMColor convertConfig8888ToPMColor(SkCanvas::Config8888 config8888,
break;
default:
SkDEBUGFAIL("Unexpected Config8888");
break;
return 0;
}
if (*premul) {
r = SkMulDiv255Ceiling(r, a);