| Index: Source/core/svg/graphics/SVGImage.cpp
|
| diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
|
| index edf144eb476899707ddb53f71ca610ab8bcbec71..780de55a76bda19714d75545b875ca3e0789f388 100644
|
| --- a/Source/core/svg/graphics/SVGImage.cpp
|
| +++ b/Source/core/svg/graphics/SVGImage.cpp
|
| @@ -285,27 +285,31 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl
|
| view->scrollToFragment(m_url);
|
|
|
| {
|
| - DisplayItemListContextRecorder contextRecorder(*context);
|
| - GraphicsContext& paintContext = contextRecorder.context();
|
| -
|
| - ClipRecorder clipRecorder(paintContext, *this, DisplayItem::ClipNodeImage, LayoutRect(enclosingIntRect(dstRect)));
|
| -
|
| - bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode;
|
| - OwnPtr<CompositingRecorder> compositingRecorder;
|
| - if (hasCompositing || opacity < 1)
|
| - compositingRecorder = adoptPtr(new CompositingRecorder(paintContext, *this, compositeOp, opacity));
|
| -
|
| - // We can only draw the entire frame, clipped to the rect we want. So compute where the top left
|
| - // of the image would be if we were drawing without clipping, and translate accordingly.
|
| - FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height());
|
| - FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.location().y() * scale.height());
|
| - FloatPoint destOffset = dstRect.location() - topLeftOffset;
|
| - AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
|
| - transform.scale(scale.width(), scale.height());
|
| - TransformRecorder transformRecorder(paintContext, *this, transform);
|
| -
|
| - view->updateLayoutAndStyleForPainting();
|
| - view->paint(&paintContext, enclosingIntRect(srcRect));
|
| + LayoutRect paintRect(enclosingIntRect(dstRect));
|
| + SkPictureBuilder pictureBuilder(paintRect);
|
| +
|
| + {
|
| + ClipRecorder clipRecorder(pictureBuilder.context(), *this, DisplayItem::ClipNodeImage, paintRect);
|
| +
|
| + bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode;
|
| + OwnPtr<CompositingRecorder> compositingRecorder;
|
| + if (hasCompositing || opacity < 1)
|
| + compositingRecorder = adoptPtr(new CompositingRecorder(pictureBuilder.context(), *this, compositeOp, opacity));
|
| +
|
| + // We can only draw the entire frame, clipped to the rect we want. So compute where the top left
|
| + // of the image would be if we were drawing without clipping, and translate accordingly.
|
| + FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height());
|
| + FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.location().y() * scale.height());
|
| + FloatPoint destOffset = dstRect.location() - topLeftOffset;
|
| + AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
|
| + transform.scale(scale.width(), scale.height());
|
| + TransformRecorder transformRecorder(pictureBuilder.context(), *this, transform);
|
| +
|
| + view->updateLayoutAndStyleForPainting();
|
| + view->paint(&pictureBuilder.context(), enclosingIntRect(srcRect));
|
| + }
|
| +
|
| + pictureBuilder.endRecording()->playback(context->canvas());
|
| ASSERT(!view->needsLayout());
|
| }
|
|
|
|
|