blob: e1ce1f32c4fd7f00919a8a131eb1f519944870d7 [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001#if 0 // disabled
2// Copyright 2019 Google LLC.
3// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05004#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04005// HASH=6a63dfdd62ab77ff57783af8c33d7b78
Hal Canarya7181e7c2019-03-18 16:06:34 -04006REG_FIDDLE(ImageInfo_ByteSizeOverflowed, 256, 256, true, 0) {
Hal Canary87515122019-03-15 14:22:51 -04007void draw(SkCanvas* canvas) {
8 if (sizeof(size_t) == 8) {
9 SkImageInfo info = SkImageInfo::MakeN32Premul(2, 1000000000);
10 for (size_t rowBytes = 100000000; rowBytes < 10000000000000LL; rowBytes *= 10) {
11 const size_t size = info.computeByteSize(rowBytes);
12 SkDebugf("rowBytes:%llu size:%llu overflowed:%s\n", rowBytes, size,
13 SkImageInfo::ByteSizeOverflowed(size) ? "true" : "false");
14 }
15 }
16}
17} // END FIDDLE
18#endif // disabled