I am filling a canvas with an image using a bitmap shader set to clamp mode.
It's clamping but only ever on a random selection of edges.
I'm clearing my bitmap with red erase color, then drawing an image in the center with:
SkShader* s = SkShader::CreateBitmapShader(src, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
result->eraseARGB(255, 255, 0, 0);
paint.setShader(s)->unref();
canvas.translate(SkIntToScalar(srcOffset.fX - bounds.fLeft), SkIntToScalar(srcOffset.fY - bounds.fTop));
canvas.drawPaint(paint);
e.g. one pass might show this... (looks like left edge is clamping correctly).

Where another pass (just nudging one pix and re-rendering) will look like: (looks like bottom edge is clamping correctly).

I'm just trying to draw the image in the center and have it clamp the edge pixels outwards to the edge of the total device.
Any idea what I might be doing wrong?