| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_RESOURCE_UTIL_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_UTIL_H_ |
| 6 #define CC_RESOURCES_RESOURCE_UTIL_H_ | 6 #define CC_RESOURCES_RESOURCE_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include <limits> | 10 #include <limits> |
| 9 | 11 |
| 12 #include "base/macros.h" |
| 10 #include "base/numerics/safe_math.h" | 13 #include "base/numerics/safe_math.h" |
| 11 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 12 #include "cc/base/math_util.h" | 15 #include "cc/base/math_util.h" |
| 13 #include "cc/resources/resource_format.h" | 16 #include "cc/resources/resource_format.h" |
| 14 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 15 | 18 |
| 16 namespace cc { | 19 namespace cc { |
| 17 | 20 |
| 18 class CC_EXPORT ResourceUtil { | 21 class CC_EXPORT ResourceUtil { |
| 19 public: | 22 public: |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 bytes = MathUtil::UncheckedRoundUp<T>(bytes, 4); | 216 bytes = MathUtil::UncheckedRoundUp<T>(bytes, 4); |
| 214 if (verify_size) | 217 if (verify_size) |
| 215 bytes *= height; | 218 bytes *= height; |
| 216 | 219 |
| 217 return bytes; | 220 return bytes; |
| 218 } | 221 } |
| 219 | 222 |
| 220 } // namespace cc | 223 } // namespace cc |
| 221 | 224 |
| 222 #endif // CC_RESOURCES_RESOURCE_UTIL_H_ | 225 #endif // CC_RESOURCES_RESOURCE_UTIL_H_ |
| OLD | NEW |