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

Unified Diff: components/test_runner/pixel_dump.cc

Issue 1876653003: Register clipboard image blob in the browser process to copy data less. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 | content/browser/renderer_host/clipboard_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/pixel_dump.cc
diff --git a/components/test_runner/pixel_dump.cc b/components/test_runner/pixel_dump.cc
index 8587f184c2545238e0462c0949cf074cf8bd9ce0..b2bd91a3c4996b2d1a18143f2234327149a88409 100644
--- a/components/test_runner/pixel_dump.cc
+++ b/components/test_runner/pixel_dump.cc
@@ -15,10 +15,9 @@
// FIXME: Including platform_canvas.h here is a layering violation.
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/Platform.h"
-#include "third_party/WebKit/public/platform/WebClipboard.h"
#include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallback.h"
-#include "third_party/WebKit/public/platform/WebData.h"
#include "third_party/WebKit/public/platform/WebImage.h"
+#include "third_party/WebKit/public/platform/WebMockClipboard.h"
#include "third_party/WebKit/public/platform/WebPoint.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebPagePopup.h"
@@ -192,9 +191,9 @@ void CopyImageAtAndCapturePixels(
return;
}
- blink::WebData data = blink::Platform::current()->clipboard()->readImage(
- blink::WebClipboard::Buffer());
- blink::WebImage image = blink::WebImage::fromData(data, blink::WebSize());
+ blink::WebImage image = static_cast<blink::WebMockClipboard*>(
+ blink::Platform::current()->clipboard())
+ ->readRawImage(blink::WebClipboard::Buffer());
const SkBitmap& bitmap = image.getSkBitmap();
SkAutoLockPixels autoLock(bitmap);
callback.Run(bitmap);
« no previous file with comments | « no previous file | content/browser/renderer_host/clipboard_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698