| Index: Source/core/frame/Frame.cpp
|
| diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
|
| index 7886475dc9376a359111fc0f84045272f6073f13..ce78d997bc751b5b17980e8396984f1b2424e607 100644
|
| --- a/Source/core/frame/Frame.cpp
|
| +++ b/Source/core/frame/Frame.cpp
|
| @@ -65,6 +65,7 @@
|
| #include "core/rendering/RenderPart.h"
|
| #include "core/rendering/RenderView.h"
|
| #include "core/svg/SVGDocument.h"
|
| +#include "platform/graphics/UnacceleratedImageBufferSurface.h"
|
| #include "wtf/PassOwnPtr.h"
|
| #include "wtf/RefCountedLeakCounter.h"
|
| #include "wtf/StdLibExtras.h"
|
| @@ -649,15 +650,16 @@ PassOwnPtr<DragImage> Frame::nodeImage(Node* node)
|
| paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
|
| paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
|
|
|
| - OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
|
| - if (!buffer)
|
| + OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSurface(paintingRect.size(), NonOpaque, deviceScaleFactor));
|
| + if (!surface->isValid())
|
| return nullptr;
|
| - buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
|
| - buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
|
| + ImageBuffer buffer(surface.release());
|
| + buffer.context()->translate(-paintingRect.x(), -paintingRect.y());
|
| + buffer.context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
|
|
|
| - m_view->paintContents(buffer->context(), paintingRect);
|
| + m_view->paintContents(buffer.context(), paintingRect);
|
|
|
| - RefPtr<Image> image = buffer->copyImage();
|
| + RefPtr<Image> image = buffer.copyImage();
|
| return DragImage::create(image.get(), renderer->shouldRespectImageOrientation());
|
| }
|
|
|
| @@ -678,15 +680,16 @@ PassOwnPtr<DragImage> Frame::dragImageForSelection()
|
| paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
|
| paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
|
|
|
| - OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
|
| - if (!buffer)
|
| + OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSurface(paintingRect.size(), NonOpaque, deviceScaleFactor));
|
| + if (!surface->isValid())
|
| return nullptr;
|
| - buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
|
| - buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
|
| + ImageBuffer buffer(surface.release());
|
| + buffer.context()->translate(-paintingRect.x(), -paintingRect.y());
|
| + buffer.context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
|
|
|
| - m_view->paintContents(buffer->context(), paintingRect);
|
| + m_view->paintContents(buffer.context(), paintingRect);
|
|
|
| - RefPtr<Image> image = buffer->copyImage();
|
| + RefPtr<Image> image = buffer.copyImage();
|
| return DragImage::create(image.get());
|
| }
|
|
|
|
|