| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 FloatSize adjustedSrcSize = scaledSrc.size(); | 186 FloatSize adjustedSrcSize = scaledSrc.size(); |
| 187 adjustedSrcSize.scale(roundedContainerSize.width() / containerSize.width(),
roundedContainerSize.height() / containerSize.height()); | 187 adjustedSrcSize.scale(roundedContainerSize.width() / containerSize.width(),
roundedContainerSize.height() / containerSize.height()); |
| 188 scaledSrc.setSize(adjustedSrcSize); | 188 scaledSrc.setSize(adjustedSrcSize); |
| 189 | 189 |
| 190 draw(context, dstRect, scaledSrc, compositeOp, blendMode); | 190 draw(context, dstRect, scaledSrc, compositeOp, blendMode); |
| 191 } | 191 } |
| 192 | 192 |
| 193 PassRefPtr<NativeImageSkia> SVGImage::nativeImageForCurrentFrame() | 193 PassRefPtr<NativeImageSkia> SVGImage::nativeImageForCurrentFrame() |
| 194 { | 194 { |
| 195 if (!m_page) | 195 if (!m_page) |
| 196 return 0; | 196 return nullptr; |
| 197 | 197 |
| 198 OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size()); | 198 OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size()); |
| 199 if (!buffer) | 199 if (!buffer) |
| 200 return 0; | 200 return nullptr; |
| 201 | 201 |
| 202 drawForContainer(buffer->context(), size(), 1, rect(), rect(), CompositeSour
ceOver, blink::WebBlendModeNormal); | 202 drawForContainer(buffer->context(), size(), 1, rect(), rect(), CompositeSour
ceOver, blink::WebBlendModeNormal); |
| 203 | 203 |
| 204 // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here. | 204 // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here. |
| 205 return buffer->copyImage(CopyBackingStore)->nativeImageForCurrentFrame(); | 205 return buffer->copyImage(CopyBackingStore)->nativeImageForCurrentFrame(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize
containerSize, float zoom, const FloatRect& srcRect, | 208 void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize
containerSize, float zoom, const FloatRect& srcRect, |
| 209 const FloatSize& scale, const FloatPoint& phase, CompositeOperator composite
Op, const FloatRect& dstRect, blink::WebBlendMode blendMode, const IntSize& repe
atSpacing) | 209 const FloatSize& scale, const FloatPoint& phase, CompositeOperator composite
Op, const FloatRect& dstRect, blink::WebBlendMode blendMode, const IntSize& repe
atSpacing) |
| 210 { | 210 { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 return m_page; | 413 return m_page; |
| 414 } | 414 } |
| 415 | 415 |
| 416 String SVGImage::filenameExtension() const | 416 String SVGImage::filenameExtension() const |
| 417 { | 417 { |
| 418 return "svg"; | 418 return "svg"; |
| 419 } | 419 } |
| 420 | 420 |
| 421 } | 421 } |
| OLD | NEW |