Created
December 3, 2009 21:08
-
-
Save tolmasky/248522 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void renderSubtreeToImage(ImageBuffer* image, RenderObject* item) | |
| { | |
| ASSERT(item); | |
| ASSERT(image); | |
| ASSERT(image->context()); | |
| RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0); | |
| // FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever | |
| // called with one of those, we will read from the wrong offset in an object due to a bad cast. | |
| RenderSVGContainer* svgContainer = 0; | |
| if (item && item->isSVGContainer()) | |
| svgContainer = toRenderSVGContainer(item); | |
| bool drawsContents = svgContainer ? svgContainer->drawsContents() : false; | |
| if (svgContainer && !drawsContents) | |
| svgContainer->setDrawsContents(true); | |
| item->layoutIfNeeded(); | |
| item->paint(info, 0, 0); | |
| if (svgContainer && !drawsContents) | |
| svgContainer->setDrawsContents(false); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment