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

Unified Diff: cc/resources/resource_util.h

Issue 1202843008: cc: Fix BytesPerPixel issue and refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving few functions to their own files. Created 5 years, 6 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
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/resource_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_util.h
diff --git a/cc/resources/resource_util.h b/cc/resources/resource_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..df6b33d3fcbb9ec63060c16d0ef1e5d346e2db7d
--- /dev/null
+++ b/cc/resources/resource_util.h
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_RESOURCES_RESOURCE_UTIL_H_
+#define CC_RESOURCES_RESOURCE_UTIL_H_
+
+#include "cc/base/cc_export.h"
+#include "cc/resources/resource_format.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace cc {
+
+class CC_EXPORT ResourceUtil {
+ public:
+ // Return true if the call to UncheckedMemorySizeBytes would return a value
+ // that fits in a size_t.
prashant.n 2015/06/25 15:23:04 These are just the functions moved out resource_pr
+ static bool VerifySizeInBytes(const gfx::Size& size, ResourceFormat format);
+ static size_t CheckedMemorySizeBytes(const gfx::Size& size,
+ ResourceFormat format);
+ static size_t UncheckedMemorySizeBytes(const gfx::Size& size,
+ ResourceFormat format);
+ static size_t UncheckedMemorySizeBytesAligned(const gfx::Size& size,
+ ResourceFormat format);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResourceUtil);
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_RESOURCE_UTIL_H_
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/resource_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698