| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 const IntSize& repeatSpacing) | 237 const IntSize& repeatSpacing) |
| 238 { | 238 { |
| 239 // Tile adjusted for scaling/stretch. | 239 // Tile adjusted for scaling/stretch. |
| 240 FloatRect tile(srcRect); | 240 FloatRect tile(srcRect); |
| 241 tile.scale(tileScale.width(), tileScale.height()); | 241 tile.scale(tileScale.width(), tileScale.height()); |
| 242 | 242 |
| 243 // Expand the tile to account for repeat spacing. | 243 // Expand the tile to account for repeat spacing. |
| 244 FloatRect spacedTile(tile); | 244 FloatRect spacedTile(tile); |
| 245 spacedTile.expand(repeatSpacing); | 245 spacedTile.expand(repeatSpacing); |
| 246 | 246 |
| 247 SkPictureBuilder patternPicture(spacedTile); | 247 SkPictureBuilder patternPicture(spacedTile, nullptr, context); |
| 248 { | 248 { |
| 249 DrawingRecorder patternPictureRecorder(patternPicture.context(), *this,
DisplayItem::Type::SVGImage, spacedTile); | 249 DrawingRecorder patternPictureRecorder(patternPicture.context(), *this,
DisplayItem::Type::SVGImage, spacedTile); |
| 250 if (!patternPictureRecorder.canUseCachedDrawing()) { | 250 if (!patternPictureRecorder.canUseCachedDrawing()) { |
| 251 // When generating an expanded tile, make sure we don't draw into th
e spacing area. | 251 // When generating an expanded tile, make sure we don't draw into th
e spacing area. |
| 252 if (tile != spacedTile) | 252 if (tile != spacedTile) |
| 253 patternPicture.context().clip(tile); | 253 patternPicture.context().clip(tile); |
| 254 SkPaint paint; | 254 SkPaint paint; |
| 255 drawForContainer(patternPicture.context().canvas(), paint, container
Size, zoom, tile, srcRect); | 255 drawForContainer(patternPicture.context().canvas(), paint, container
Size, zoom, tile, srcRect); |
| 256 } | 256 } |
| 257 } | 257 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 return m_page; | 484 return m_page; |
| 485 } | 485 } |
| 486 | 486 |
| 487 String SVGImage::filenameExtension() const | 487 String SVGImage::filenameExtension() const |
| 488 { | 488 { |
| 489 return "svg"; | 489 return "svg"; |
| 490 } | 490 } |
| 491 | 491 |
| 492 } | 492 } |
| OLD | NEW |