OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_RESOURCES_RESOURCE_UTIL_H_ |
| 6 #define CC_RESOURCES_RESOURCE_UTIL_H_ |
| 7 |
| 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/resources/resource_format.h" |
| 10 #include "ui/gfx/geometry/size.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 class CC_EXPORT ResourceUtil { |
| 15 public: |
| 16 // Return true if the call to SizeInBytes would return a value |
| 17 // that fits in a size_t. |
| 18 static bool VerifySizeInBytes(const gfx::Size& size, ResourceFormat format); |
| 19 static size_t CheckedSizeInBytes(const gfx::Size& size, |
| 20 ResourceFormat format); |
| 21 static size_t WidthInBytes(size_t width, ResourceFormat format); |
| 22 static size_t SizeInBytes(const gfx::Size& size, ResourceFormat format); |
| 23 static size_t WidthInBytesAligned(size_t width, ResourceFormat format); |
| 24 static size_t SizeInBytesAligned(const gfx::Size& size, |
| 25 ResourceFormat format); |
| 26 |
| 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(ResourceUtil); |
| 29 }; |
| 30 |
| 31 } // namespace cc |
| 32 |
| 33 #endif // CC_RESOURCES_RESOURCE_UTIL_H_ |
OLD | NEW |