From 63e53de157e75e504a6bf1a678cebaea5acf72b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Mon, 22 Aug 2016 17:57:22 +0200 Subject: [core] standardize on uint16_t for texture sizes --- include/mbgl/util/image.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/mbgl/util') diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp index 124cdca7cd..795d1f9d1a 100644 --- a/include/mbgl/util/image.hpp +++ b/include/mbgl/util/image.hpp @@ -18,12 +18,12 @@ class Image : private util::noncopyable { public: Image() = default; - Image(size_t w, size_t h) + Image(uint16_t w, uint16_t h) : width(w), height(h), data(std::make_unique(size())) {} - Image(size_t w, size_t h, std::unique_ptr data_) + Image(uint16_t w, uint16_t h, std::unique_ptr data_) : width(w), height(h), data(std::move(data_)) {} @@ -46,11 +46,11 @@ public: rhs.data.get() + rhs.size()); } - size_t stride() const { return width * 4; } - size_t size() const { return width * height * 4; } + size_t stride() const { return static_cast(width) * 4; } + size_t size() const { return static_cast(width) * height * 4; } - size_t width = 0; - size_t height = 0; + uint16_t width = 0; + uint16_t height = 0; std::unique_ptr data; }; -- cgit v1.2.1