| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 class SVGImageBufferTools { | 36 class SVGImageBufferTools { |
| 37 WTF_MAKE_NONCOPYABLE(SVGImageBufferTools); | 37 WTF_MAKE_NONCOPYABLE(SVGImageBufferTools); |
| 38 | 38 |
| 39 public: | 39 public: |
| 40 static bool createImageBuffer(const FloatRect& paintRect, const AffineTransf
orm& absoluteTransform, OwnPtr<ImageBuffer>&, ColorSpace, RenderingMode); | 40 static bool createImageBuffer(const FloatRect& paintRect, const AffineTransf
orm& absoluteTransform, OwnPtr<ImageBuffer>&, ColorSpace, RenderingMode); |
| 41 // Patterns need a different float-to-integer coordinate mapping. | 41 // Patterns need a different float-to-integer coordinate mapping. |
| 42 static bool createImageBufferForPattern(const FloatRect& absoluteTargetRect,
const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ColorSpace, R
enderingMode); | 42 static bool createImageBufferForPattern(const FloatRect& absoluteTargetRect,
const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ColorSpace, R
enderingMode); |
| 43 | 43 |
| 44 static void renderSubtreeToImageBuffer(ImageBuffer*, RenderObject*, const Af
fineTransform&); | 44 static void renderSubtreeToImageBuffer(ImageBuffer*, RenderObject*, const Af
fineTransform&); |
| 45 static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absol
uteTransform, const FloatRect& targetRect, OwnPtr<ImageBuffer>&); | 45 static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absol
uteTransform, const FloatRect& targetRect, OwnPtr<ImageBuffer>&, bool safeToClea
r); |
| 46 | 46 |
| 47 static void calculateTransformationToOutermostSVGCoordinateSystem(const Rend
erObject*, AffineTransform& absoluteTransform); | 47 static void calculateTransformationToOutermostSVGCoordinateSystem(const Rend
erObject*, AffineTransform& absoluteTransform); |
| 48 static IntSize clampedAbsoluteSize(const IntSize&); | 48 static IntSize clampedAbsoluteSize(const IntSize&); |
| 49 static FloatRect clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRe
ct); | 49 static FloatRect clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRe
ct); |
| 50 static void clear2DRotation(AffineTransform&); | 50 static void clear2DRotation(AffineTransform&); |
| 51 | 51 |
| 52 static IntRect calculateImageBufferRect(const FloatRect& targetRect, const A
ffineTransform& absoluteTransform) | 52 static IntRect calculateImageBufferRect(const FloatRect& targetRect, const A
ffineTransform& absoluteTransform) |
| 53 { | 53 { |
| 54 return enclosingIntRect(absoluteTransform.mapRect(targetRect)); | 54 return enclosingIntRect(absoluteTransform.mapRect(targetRect)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 SVGImageBufferTools() { } | 58 SVGImageBufferTools() { } |
| 59 ~SVGImageBufferTools() { } | 59 ~SVGImageBufferTools() { } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } | 62 } |
| 63 | 63 |
| 64 #endif | 64 #endif |
| 65 #endif | 65 #endif |
| OLD | NEW |