Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 
| 5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 
| 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 
| 8 * | 8 * | 
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or | 
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public | 
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" | 
| 32 #include "core/frame/Settings.h" | 32 #include "core/frame/Settings.h" | 
| 33 #include "core/rendering/RenderLayer.h" | 33 #include "core/rendering/RenderLayer.h" | 
| 34 #include "core/rendering/svg/RenderSVGImage.h" | 34 #include "core/rendering/svg/RenderSVGImage.h" | 
| 35 #include "core/rendering/svg/RenderSVGResource.h" | 35 #include "core/rendering/svg/RenderSVGResource.h" | 
| 36 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 36 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 
| 37 #include "core/rendering/svg/RenderSVGResourceMasker.h" | 37 #include "core/rendering/svg/RenderSVGResourceMasker.h" | 
| 38 #include "core/rendering/svg/SVGResources.h" | 38 #include "core/rendering/svg/SVGResources.h" | 
| 39 #include "core/rendering/svg/SVGResourcesCache.h" | 39 #include "core/rendering/svg/SVGResourcesCache.h" | 
| 40 | 40 | 
| 41 static int kMaxImageBufferSize = 4096; | |
| 42 | |
| 43 namespace blink { | 41 namespace blink { | 
| 44 | 42 | 
| 45 static inline bool isRenderingMaskImage(RenderObject* object) | 43 static inline bool isRenderingMaskImage(RenderObject* object) | 
| 46 { | 44 { | 
| 47 if (object->frame() && object->frame()->view()) | 45 if (object->frame() && object->frame()->view()) | 
| 48 return object->frame()->view()->paintBehavior() & PaintBehaviorRendering SVGMask; | 46 return object->frame()->view()->paintBehavior() & PaintBehaviorRendering SVGMask; | 
| 49 return false; | 47 return false; | 
| 50 } | 48 } | 
| 51 | 49 | 
| 52 SVGRenderingContext::~SVGRenderingContext() | 50 SVGRenderingContext::~SVGRenderingContext() | 
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 AffineTransform& contentTransformation = currentContentTransformation(); | 254 AffineTransform& contentTransformation = currentContentTransformation(); | 
| 257 AffineTransform savedContentTransformation = contentTransformation; | 255 AffineTransform savedContentTransformation = contentTransformation; | 
| 258 contentTransformation = subtreeContentTransformation * contentTransformation ; | 256 contentTransformation = subtreeContentTransformation * contentTransformation ; | 
| 259 | 257 | 
| 260 ASSERT(!item->needsLayout()); | 258 ASSERT(!item->needsLayout()); | 
| 261 item->paint(info, IntPoint()); | 259 item->paint(info, IntPoint()); | 
| 262 | 260 | 
| 263 contentTransformation = savedContentTransformation; | 261 contentTransformation = savedContentTransformation; | 
| 264 } | 262 } | 
| 265 | 263 | 
| 266 FloatRect SVGRenderingContext::clampedAbsoluteTargetRect(const FloatRect& absolu teTargetRect) | |
| 267 { | |
| 268 const FloatSize maxImageBufferSize(kMaxImageBufferSize, kMaxImageBufferSize) ; | |
| 269 return FloatRect(absoluteTargetRect.location(), absoluteTargetRect.size().sh runkTo(maxImageBufferSize)); | |
| 
 
Erik Dahlström (inactive)
2014/08/08 08:01:02
Does the new codepath have similar guards against
 
f(malita)
2014/08/08 15:30:36
Yes, just landed yesterday :) https://codereview.c
 
 | |
| 270 } | |
| 271 | |
| 272 void SVGRenderingContext::clear2DRotation(AffineTransform& transform) | 264 void SVGRenderingContext::clear2DRotation(AffineTransform& transform) | 
| 273 { | 265 { | 
| 274 AffineTransform::DecomposedType decomposition; | 266 AffineTransform::DecomposedType decomposition; | 
| 275 transform.decompose(decomposition); | 267 transform.decompose(decomposition); | 
| 276 decomposition.angle = 0; | 268 decomposition.angle = 0; | 
| 277 transform.recompose(decomposition); | 269 transform.recompose(decomposition); | 
| 278 } | 270 } | 
| 279 | 271 | 
| 280 bool SVGRenderingContext::bufferForeground(OwnPtr<ImageBuffer>& imageBuffer) | 272 bool SVGRenderingContext::bufferForeground(OwnPtr<ImageBuffer>& imageBuffer) | 
| 281 { | 273 { | 
| (...skipping 20 matching lines...) Expand all Loading... | |
| 302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 294 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 
| 303 } else | 295 } else | 
| 304 return false; | 296 return false; | 
| 305 } | 297 } | 
| 306 | 298 | 
| 307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 299 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 
| 308 return true; | 300 return true; | 
| 309 } | 301 } | 
| 310 | 302 | 
| 311 } | 303 } | 
| OLD | NEW |