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

Unified Diff: Source/core/frame/Frame.cpp

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase mayhem Created 7 years 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 | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.cpp
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index 3109cb225fd777456bebb6368d9ca6efa6162734..98c1b17808d24fe1e80124feacb6f1836bdc6c1d 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -649,9 +649,10 @@ PassOwnPtr<DragImage> Frame::nodeImage(Node* node)
paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
+ OwnPtr<ImageBuffer> buffer = ImageBuffer::create(paintingRect.size());
if (!buffer)
return nullptr;
+ buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
@@ -678,9 +679,10 @@ PassOwnPtr<DragImage> Frame::dragImageForSelection()
paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
+ OwnPtr<ImageBuffer> buffer = ImageBuffer::create(paintingRect.size());
if (!buffer)
return nullptr;
+ buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
« no previous file with comments | « no previous file | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698