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

Unified Diff: chrome/renderer/webplugin_delegate_pepper.cc

Issue 1611011: fixing bug in 2D context painted area pixel count computation ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webplugin_delegate_pepper.cc
===================================================================
--- chrome/renderer/webplugin_delegate_pepper.cc (revision 43985)
+++ chrome/renderer/webplugin_delegate_pepper.cc (working copy)
@@ -480,9 +480,11 @@
} else if (state == NPExtensionsReservedStateSharedMemoryChecksum) {
if (!context)
return NPERR_INVALID_PARAM;
- int32 row_count = context->dirty.bottom - context->dirty.top + 1;
- int32 stride = context->dirty.right - context->dirty.left + 1;
- size_t length = row_count * stride * sizeof(uint32);
+ // Bytes per pixel.
+ static const int kBytesPixel = 4;
+ int32 row_count = context->dirty.bottom - context->dirty.top;
+ int32 stride = context->dirty.right - context->dirty.left;
+ size_t length = row_count * stride * kBytesPixel;
MD5Digest md5_result; // 128-bit digest
MD5Sum(context->region, length, &md5_result);
std::string hex_md5 = MD5DigestToBase16(md5_result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698