OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 if (imageBuffer) { | 287 if (imageBuffer) { |
288 AffineTransform transform = m_paintInfo->context->getCTM(); | 288 AffineTransform transform = m_paintInfo->context->getCTM(); |
289 IntSize expandedBoundingBox = expandedIntSize(boundingBox.size()); | 289 IntSize expandedBoundingBox = expandedIntSize(boundingBox.size()); |
290 IntSize bufferSize(static_cast<int>(ceil(expandedBoundingBox.width() * t
ransform.xScale())), static_cast<int>(ceil(expandedBoundingBox.height() * transf
orm.yScale()))); | 290 IntSize bufferSize(static_cast<int>(ceil(expandedBoundingBox.width() * t
ransform.xScale())), static_cast<int>(ceil(expandedBoundingBox.height() * transf
orm.yScale()))); |
291 if (bufferSize != imageBuffer->size()) | 291 if (bufferSize != imageBuffer->size()) |
292 imageBuffer.clear(); | 292 imageBuffer.clear(); |
293 } | 293 } |
294 | 294 |
295 // Create a new buffer and paint the foreground into it. | 295 // Create a new buffer and paint the foreground into it. |
296 if (!imageBuffer) { | 296 if (!imageBuffer) { |
297 if ((imageBuffer = m_paintInfo->context->createCompatibleBuffer(expanded
IntSize(boundingBox.size())))) { | 297 if ((imageBuffer = m_paintInfo->context->createRasterBuffer(expandedIntS
ize(boundingBox.size())))) { |
298 GraphicsContext* bufferedRenderingContext = imageBuffer->context(); | 298 GraphicsContext* bufferedRenderingContext = imageBuffer->context(); |
299 bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y
()); | 299 bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y
()); |
300 PaintInfo bufferedInfo(*m_paintInfo); | 300 PaintInfo bufferedInfo(*m_paintInfo); |
301 bufferedInfo.context = bufferedRenderingContext; | 301 bufferedInfo.context = bufferedRenderingContext; |
302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); |
303 } else | 303 } else |
304 return false; | 304 return false; |
305 } | 305 } |
306 | 306 |
307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
308 return true; | 308 return true; |
309 } | 309 } |
310 | 310 |
311 } | 311 } |
OLD | NEW |