From f46633f8af5296341e33ec4cdb69c71dfa997396 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Tue, 26 Sep 2017 20:07:58 +0000 Subject: Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap" This reverts commit 98a6216b18b57c2f7a0d58f542c60503686aed69. Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot: https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960 Original change's description: > guard old apis for querying byte-size of a bitmap/imageinfo/pixmap > > Previously we had size_t and uint64_t variations. > > The new (simpler) API always.. > - returns size_t, or 0 if the calculation overflowed > - returns the trimmed size (does not include rowBytes padding for the last row) > > Bug: skia: > Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e > Reviewed-on: https://skia-review.googlesource.com/50980 > Commit-Queue: Mike Reed > Reviewed-by: Florin Malita > Reviewed-by: Leon Scroggins TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/51262 Reviewed-by: Greg Daniel Commit-Queue: Greg Daniel --- tests/DrawBitmapRectTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/DrawBitmapRectTest.cpp') diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 8ad177f5c1..991290142e 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -144,10 +144,9 @@ static void test_wacky_bitmapshader(skiatest::Reporter* reporter, SkBitmap bm; if (bm.tryAllocN32Pixels(width, height)) { - bm.eraseColor(SK_ColorRED); - } else { - shouldBeDrawn = false; + // allow this to fail silently, to test the code downstream } + bm.eraseColor(SK_ColorRED); matrix.setAll(0.0078740157f, 0, @@ -180,7 +179,7 @@ static void test_wacky_bitmapshader(skiatest::Reporter* reporter, * sign-extension bleed when packing the two values (X,Y) into our 32bit * slot. * - * This tests exercises the original setup, plus 2 more to ensure that we can, + * This tests exercises the original setup, plus 3 more to ensure that we can, * in fact, handle bitmaps at 64K-1 (assuming we don't exceed the total * memory allocation limit). */ @@ -193,6 +192,7 @@ static void test_giantrepeat_crbug118018(skiatest::Reporter* reporter) { { 0x1b294, 0x7f, false }, // crbug 118018 (width exceeds 64K) { 0xFFFF, 0x7f, true }, // should draw, test max width { 0x7f, 0xFFFF, true }, // should draw, test max height + { 0xFFFF, 0xFFFF, false }, // allocation fails (too much RAM) }; for (size_t i = 0; i < SK_ARRAY_COUNT(gTests); ++i) { -- cgit v1.2.3