Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: skia/ext/skia_utils_base.cc

Issue 2668873002: cc: Add checker-imaging support to TileManager. (Closed)
Patch Set: addressed comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/tiles/image_controller_unittest.cc ('K') | « skia/ext/skia_utils_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_base.cc
diff --git a/skia/ext/skia_utils_base.cc b/skia/ext/skia_utils_base.cc
index c56730bd9bc8f0b1c294617d2ab4e1829aca11d4..83250e17cd752b3a3035337f2de11eb0cd4544f3 100644
--- a/skia/ext/skia_utils_base.cc
+++ b/skia/ext/skia_utils_base.cc
@@ -4,6 +4,7 @@
#include <stdint.h>
+#include "base/numerics/safe_math.h"
#include "skia/ext/skia_utils_base.h"
#include "third_party/skia/include/core/SkFontLCDConfig.h"
@@ -101,5 +102,12 @@ SkPixelGeometry ComputeDefaultPixelGeometry() {
return gGeo[index];
}
+size_t SafeSizeOfImage(const SkImage* image) {
vmpstr 2017/02/17 19:08:49 Can you extract this as a separate patch and chang
Khushal 2017/02/17 19:10:29 Since I've already added it here, how about starti
+ base::CheckedNumeric<size_t> checked_size = 4;
+ checked_size *= image->width();
+ checked_size *= image->height();
+ return checked_size.ValueOrDefault(std::numeric_limits<size_t>::max());
+}
+
} // namespace skia
« cc/tiles/image_controller_unittest.cc ('K') | « skia/ext/skia_utils_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698