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

Unified Diff: webkit/tools/test_shell/image_decoder_unittest.cc

Issue 121001: Update DEPS to pull in upstream change that removes RGBA32Buffer::bitmap(), a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « webkit/port/bindings/v8/v8_proxy.cpp ('k') | webkit/webkit.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/image_decoder_unittest.cc
===================================================================
--- webkit/tools/test_shell/image_decoder_unittest.cc (revision 18075)
+++ webkit/tools/test_shell/image_decoder_unittest.cc (working copy)
@@ -46,21 +46,19 @@
#ifdef CALCULATE_MD5_SUMS
void SaveMD5Sum(const std::wstring& path, WebCore::RGBA32Buffer* buffer) {
- // Create the file to write.
- ScopedHandle handle(CreateFile(path.c_str(), GENERIC_WRITE, 0,
- NULL, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, NULL));
- ASSERT_TRUE(handle.IsValid());
-
// Calculate MD5 sum.
MD5Digest digest;
- SkAutoLockPixels bmp_lock(buffer->bitmap());
- MD5Sum(buffer->bitmap().getPixels(),
- buffer->rect().width() * buffer->rect().height() * sizeof(unsigned),
- &digest);
+ scoped_ptr<NativeImageSkia> image_data(buffer->asNewNativeImage());
+ {
+ SkAutoLockPixels bmp_lock(*image_data);
+ MD5Sum(image_data->getPixels(),
+ image_data->width() * image_data->height() * sizeof(uint32_t),
+ &digest);
+ }
// Write sum to disk.
- int bytes_written = file_util::WriteFile(path, &digest, sizeof digest);
+ int bytes_written = file_util::WriteFile(path,
+ reinterpret_cast<const char*>(&digest), sizeof digest);
ASSERT_EQ(sizeof digest, bytes_written);
}
#else
@@ -77,9 +75,13 @@
// Calculate MD5 sum.
MD5Digest actual_digest;
- SkAutoLockPixels bmp_lock(image_buffer->bitmap());
- MD5Sum(image_buffer->bitmap().getPixels(), image_buffer->rect().width() *
- image_buffer->rect().height() * sizeof(unsigned), &actual_digest);
+ scoped_ptr<NativeImageSkia> image_data(image_buffer->asNewNativeImage());
+ {
+ SkAutoLockPixels bmp_lock(*image_data);
+ MD5Sum(image_data->getPixels(),
+ image_data->width() * image_data->height() * sizeof(uint32_t),
+ &actual_digest);
+ }
// Read the MD5 sum off disk.
std::string file_bytes;
« no previous file with comments | « webkit/port/bindings/v8/v8_proxy.cpp ('k') | webkit/webkit.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698