| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // there may have been a previous url/fragment that needs to be reset. | 284 // there may have been a previous url/fragment that needs to be reset. |
| 285 view->scrollToFragment(m_url); | 285 view->scrollToFragment(m_url); |
| 286 | 286 |
| 287 { | 287 { |
| 288 DisplayItemListContextRecorder contextRecorder(*context); | 288 DisplayItemListContextRecorder contextRecorder(*context); |
| 289 GraphicsContext& paintContext = contextRecorder.context(); | 289 GraphicsContext& paintContext = contextRecorder.context(); |
| 290 | 290 |
| 291 ClipRecorder clipRecorder(paintContext, *this, DisplayItem::ClipNodeImag
e, LayoutRect(enclosingIntRect(dstRect))); | 291 ClipRecorder clipRecorder(paintContext, *this, DisplayItem::ClipNodeImag
e, LayoutRect(enclosingIntRect(dstRect))); |
| 292 | 292 |
| 293 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode; | 293 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode; |
| 294 OwnPtr<CompositingRecorder> compositingRecorder; | 294 CompositingRecorder compositingRecorder(paintContext, *this); |
| 295 if (hasCompositing || opacity < 1) | 295 if (hasCompositing || opacity < 1) |
| 296 compositingRecorder = adoptPtr(new CompositingRecorder(paintContext,
*this, compositeOp, opacity)); | 296 compositingRecorder.begin(compositeOp, opacity); |
| 297 | 297 |
| 298 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left | 298 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left |
| 299 // of the image would be if we were drawing without clipping, and transl
ate accordingly. | 299 // of the image would be if we were drawing without clipping, and transl
ate accordingly. |
| 300 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); | 300 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); |
| 301 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); | 301 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); |
| 302 FloatPoint destOffset = dstRect.location() - topLeftOffset; | 302 FloatPoint destOffset = dstRect.location() - topLeftOffset; |
| 303 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); | 303 AffineTransform transform = AffineTransform::translation(destOffset.x(),
destOffset.y()); |
| 304 transform.scale(scale.width(), scale.height()); | 304 transform.scale(scale.width(), scale.height()); |
| 305 TransformRecorder transformRecorder(paintContext, *this, transform); | 305 TransformRecorder transformRecorder(paintContext, *this, transform); |
| 306 | 306 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 return m_page; | 457 return m_page; |
| 458 } | 458 } |
| 459 | 459 |
| 460 String SVGImage::filenameExtension() const | 460 String SVGImage::filenameExtension() const |
| 461 { | 461 { |
| 462 return "svg"; | 462 return "svg"; |
| 463 } | 463 } |
| 464 | 464 |
| 465 } | 465 } |
| OLD | NEW |