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

Unified Diff: cc/resources/resource.h

Issue 1202843008: cc: Fix BytesPerPixel issue and refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: row bytes aligned 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 | « no previous file | cc/resources/resource_provider.cc » ('j') | cc/resources/resource_provider.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource.h
diff --git a/cc/resources/resource.h b/cc/resources/resource.h
index f9138fbb876ef405c8afada390cf4031f92f4b92..d0c60599dea44dc766804fcda8552882be46f59f 100644
--- a/cc/resources/resource.h
+++ b/cc/resources/resource.h
@@ -51,8 +51,9 @@ class CC_EXPORT Resource {
inline static size_t UncheckedMemorySizeBytes(const gfx::Size& size,
ResourceFormat format) {
DCHECK(VerifySizeInBytes(size, format));
- return static_cast<size_t>(BitsPerPixel(format)) * size.width() *
- size.height() / 8;
reveman 2015/06/24 18:02:26 hm, looks like this was broken for height < 8 befo
vmpstr 2015/06/24 18:46:14 I think the order of multiplicative operations is
+ return (static_cast<size_t>(BitsPerPixel(format)) * size.width() *
+ size.height()) /
+ 8;
reveman 2015/06/24 18:02:26 Can you add a temporary bytes_per_row variable her
}
protected:
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | cc/resources/resource_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698