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

Unified Diff: chrome/renderer/renderer_glue.cc

Issue 28119: Chromium changes to use new WebKit, WebKitClient, and WebClipboard interfaces... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « chrome/renderer/renderer.vcproj ('k') | webkit/build/WebKit/SConscript » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/renderer_glue.cc
===================================================================
--- chrome/renderer/renderer_glue.cc (revision 10343)
+++ chrome/renderer/renderer_glue.cc (working copy)
@@ -84,15 +84,15 @@
};
#if defined(OS_WIN)
-// This definition of WriteBitmap uses shared memory to communicate across
-// processes.
-void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) {
- // do not try to write a bitmap more than once
+// This definition of WriteBitmapFromPixels uses shared memory to communicate
+// across processes.
+void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
+ const gfx::Size& size) {
+ // Do not try to write a bitmap more than once
if (shared_buf_)
return;
- size_t buf_size = bitmap.getSize();
- gfx::Size size(bitmap.width(), bitmap.height());
+ size_t buf_size = 4 * size.width() * size.height();
// Allocate a shared memory buffer to hold the bitmap bits
shared_buf_ = new base::SharedMemory;
@@ -104,8 +104,7 @@
}
// Copy the bits into shared memory
- SkAutoLockPixels bitmap_lock(bitmap);
- memcpy(shared_buf_->memory(), bitmap.getPixels(), buf_size);
+ memcpy(shared_buf_->memory(), pixels, buf_size);
shared_buf_->Unmap();
Clipboard::ObjectMapParam param1, param2;
« no previous file with comments | « chrome/renderer/renderer.vcproj ('k') | webkit/build/WebKit/SConscript » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698