Remove ToolUtils::write_pixels

Change-Id: If5463ea352e4c8ec6cbb1e07cc9e461504d06b37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205300
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Brian Osman 2019-04-01 14:31:38 -04:00 committed by Skia Commit-Bot
parent 036503b07e
commit b27667a15a
4 changed files with 1 additions and 32 deletions

View File

@ -74,8 +74,7 @@ static void test_premul_alpha_roundtrip(skiatest::Reporter* reporter, SkSurface*
readBmp2.eraseColor(0);
surf->readPixels(readBmp1, 0, 0);
ToolUtils::write_pixels(
surf, readBmp1, 0, 0, gUnpremul[upmaIdx].fColorType, kUnpremul_SkAlphaType);
surf->writePixels(readBmp1, 0, 0);
surf->readPixels(readBmp2, 0, 0);
bool success = true;

View File

@ -396,7 +396,6 @@ static void test_write_pixels(skiatest::Reporter* reporter, SkSurface* surface,
rect.height(), SkToBool(tightBmp)));
uint32_t idBefore = surface->generationID();
// ToolUtils::write_pixels(&canvas, bmp, rect.fLeft, rect.fTop, ct, at);
surface->writePixels(bmp, rect.fLeft, rect.fTop);
uint32_t idAfter = surface->generationID();

View File

@ -77,28 +77,6 @@ SkColor color_to_565(SkColor color) {
return SkPixel16ToColor(color16);
}
void write_pixels(SkCanvas* canvas,
const SkBitmap& bitmap,
int x,
int y,
SkColorType colorType,
SkAlphaType alphaType) {
SkBitmap tmp(bitmap);
const SkImageInfo info = SkImageInfo::Make(tmp.width(), tmp.height(), colorType, alphaType);
canvas->writePixels(info, tmp.getPixels(), tmp.rowBytes(), x, y);
}
void write_pixels(SkSurface* surface,
const SkBitmap& src,
int x,
int y,
SkColorType colorType,
SkAlphaType alphaType) {
const SkImageInfo info = SkImageInfo::Make(src.width(), src.height(), colorType, alphaType);
surface->writePixels({info, src.getPixels(), src.rowBytes()}, x, y);
}
sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size) {
SkBitmap bm;
bm.allocPixels(SkImageInfo::MakeS32(2 * size, 2 * size, kPremul_SkAlphaType));

View File

@ -82,13 +82,6 @@ void get_text_path(const SkFont&,
SkPath*,
const SkPoint* positions = nullptr);
/**
* Call writePixels() by using the pixels from bitmap, but with an info that claims
* the pixels are colorType + alphaType
*/
void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkAlphaType);
void write_pixels(SkSurface*, const SkBitmap&, int x, int y, SkColorType, SkAlphaType);
/**
* Returns true iff all of the pixels between the two images are identical.
*