OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 buffer->context()->clearRect(enclosingIntRect(scaledRect)); | 173 buffer->context()->clearRect(enclosingIntRect(scaledRect)); |
174 | 174 |
175 // Draw SVG on top of ImageBuffer. | 175 // Draw SVG on top of ImageBuffer. |
176 draw(buffer->context(), enclosingIntRect(scaledRect), rect, ColorSpaceDevice
RGB, CompositeSourceOver); | 176 draw(buffer->context(), enclosingIntRect(scaledRect), rect, ColorSpaceDevice
RGB, CompositeSourceOver); |
177 | 177 |
178 // Reset container size & zoom to initial state. Otherwhise the size() of th
is | 178 // Reset container size & zoom to initial state. Otherwhise the size() of th
is |
179 // image would return whatever last size was set by drawSVGToImageBuffer(). | 179 // image would return whatever last size was set by drawSVGToImageBuffer(). |
180 if (zoom != 1) | 180 if (zoom != 1) |
181 frame->setPageZoomFactor(1); | 181 frame->setPageZoomFactor(1); |
182 | 182 |
183 renderer->setContainerSize(IntSize()); | 183 // Renderer may have been recreated by frame->setPageZoomFactor(zoom). So fe
tch it again. |
| 184 renderer = toRenderSVGRoot(rootElement->renderer()); |
| 185 if (renderer) |
| 186 renderer->setContainerSize(IntSize()); |
| 187 |
184 frame->view()->resize(this->size()); | 188 frame->view()->resize(this->size()); |
185 if (frame->view()->needsLayout()) | 189 if (frame->view()->needsLayout()) |
186 frame->view()->layout(); | 190 frame->view()->layout(); |
187 | 191 |
188 setImageObserver(observer); | 192 setImageObserver(observer); |
189 | 193 |
190 frame->view()->endDisableRepaints(); | 194 frame->view()->endDisableRepaints(); |
191 } | 195 } |
192 | 196 |
193 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl
oatRect& srcRect, ColorSpace, CompositeOperator compositeOp) | 197 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl
oatRect& srcRect, ColorSpace, CompositeOperator compositeOp) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceImage); | 364 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceImage); |
361 Image::reportMemoryUsage(memoryObjectInfo); | 365 Image::reportMemoryUsage(memoryObjectInfo); |
362 info.addMember(m_chromeClient); | 366 info.addMember(m_chromeClient); |
363 info.addMember(m_page); | 367 info.addMember(m_page); |
364 info.addMember(m_frameCache); | 368 info.addMember(m_frameCache); |
365 } | 369 } |
366 | 370 |
367 } | 371 } |
368 | 372 |
369 #endif // ENABLE(SVG) | 373 #endif // ENABLE(SVG) |
OLD | NEW |