| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 float opacity = context->getNormalizedAlpha() / 255.f; | 278 float opacity = context->getNormalizedAlpha() / 255.f; |
| 279 | 279 |
| 280 OwnPtr<DisplayItemList> displayItemList; | 280 OwnPtr<DisplayItemList> displayItemList; |
| 281 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 281 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
| 282 displayItemList = DisplayItemList::create(); | 282 displayItemList = DisplayItemList::create(); |
| 283 GraphicsContext recordingContext(nullptr, displayItemList.get()); | 283 GraphicsContext recordingContext(nullptr, displayItemList.get()); |
| 284 recordingContext.beginRecording(dstRect); | 284 recordingContext.beginRecording(dstRect); |
| 285 | 285 |
| 286 { | 286 { |
| 287 ClipRecorder clipRecorder(displayItemClient(), &recordingContext, Displa
yItem::ClipNodeImage, enclosingIntRect(dstRect)); | 287 ClipRecorder clipRecorder(displayItemClient(), &recordingContext, Displa
yItem::ClipNodeImage, LayoutRect(enclosingIntRect(dstRect))); |
| 288 | 288 |
| 289 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode; | 289 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode; |
| 290 OwnPtr<CompositingRecorder> compositingRecorder; | 290 OwnPtr<CompositingRecorder> compositingRecorder; |
| 291 if (hasCompositing || opacity < 1) | 291 if (hasCompositing || opacity < 1) |
| 292 compositingRecorder = adoptPtr(new CompositingRecorder(&recordingCon
text, displayItemClient(), compositeOp, opacity)); | 292 compositingRecorder = adoptPtr(new CompositingRecorder(&recordingCon
text, displayItemClient(), compositeOp, opacity)); |
| 293 | 293 |
| 294 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left | 294 // We can only draw the entire frame, clipped to the rect we want. So co
mpute where the top left |
| 295 // of the image would be if we were drawing without clipping, and transl
ate accordingly. | 295 // of the image would be if we were drawing without clipping, and transl
ate accordingly. |
| 296 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); | 296 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr
cRect.height()); |
| 297 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); | 297 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.
location().y() * scale.height()); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 return m_page; | 461 return m_page; |
| 462 } | 462 } |
| 463 | 463 |
| 464 String SVGImage::filenameExtension() const | 464 String SVGImage::filenameExtension() const |
| 465 { | 465 { |
| 466 return "svg"; | 466 return "svg"; |
| 467 } | 467 } |
| 468 | 468 |
| 469 } | 469 } |
| OLD | NEW |