diff options
author | Greg Daniel <egdaniel@google.com> | 2017-09-26 20:07:58 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-26 20:08:07 +0000 |
commit | f46633f8af5296341e33ec4cdb69c71dfa997396 (patch) | |
tree | d6d59760f023f6855d921253d684716ae93bdc28 /tests/DrawBitmapRectTest.cpp | |
parent | 58e23039bd4a8aee2c67fa6c9e5105b925d2e561 (diff) |
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 <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
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 <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests/DrawBitmapRectTest.cpp')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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) { |