| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 m_clipBoundaries = FloatRect(); | 59 m_clipBoundaries = FloatRect(); |
| 60 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); | 60 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void RenderSVGResourceClipper::removeClientFromCache(RenderObject* client, bool
markForInvalidation) | 63 void RenderSVGResourceClipper::removeClientFromCache(RenderObject* client, bool
markForInvalidation) |
| 64 { | 64 { |
| 65 ASSERT(client); | 65 ASSERT(client); |
| 66 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); | 66 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool RenderSVGResourceClipper::applyResource(RenderObject*, RenderStyle*, Graphi
csContext*&, unsigned short) | |
| 70 { | |
| 71 // Clippers are always applied using stateful methods. | |
| 72 ASSERT_NOT_REACHED(); | |
| 73 return false; | |
| 74 } | |
| 75 | |
| 76 bool RenderSVGResourceClipper::applyStatefulResource(RenderObject* object, Graph
icsContext*& context, ClipperState& clipperState) | 69 bool RenderSVGResourceClipper::applyStatefulResource(RenderObject* object, Graph
icsContext*& context, ClipperState& clipperState) |
| 77 { | 70 { |
| 78 ASSERT(object); | 71 ASSERT(object); |
| 79 ASSERT(context); | 72 ASSERT(context); |
| 80 | 73 |
| 81 clearInvalidationMask(); | 74 clearInvalidationMask(); |
| 82 | 75 |
| 83 return applyClippingToContext(object, object->objectBoundingBox(), object->p
aintInvalidationRectInLocalCoordinates(), context, clipperState); | 76 return applyClippingToContext(object, object->objectBoundingBox(), object->p
aintInvalidationRectInLocalCoordinates(), context, clipperState); |
| 84 } | 77 } |
| 85 | 78 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (clipPathClipper) | 194 if (clipPathClipper) |
| 202 clipPathClipper->postApplyStatefulResource(this, context, clipPathCl
ipperState); | 195 clipPathClipper->postApplyStatefulResource(this, context, clipPathCl
ipperState); |
| 203 } | 196 } |
| 204 | 197 |
| 205 // Masked content layer start. | 198 // Masked content layer start. |
| 206 context->beginLayer(1, CompositeSourceIn, &paintInvalidationRect); | 199 context->beginLayer(1, CompositeSourceIn, &paintInvalidationRect); |
| 207 | 200 |
| 208 return true; | 201 return true; |
| 209 } | 202 } |
| 210 | 203 |
| 211 void RenderSVGResourceClipper::postApplyResource(RenderObject*, GraphicsContext*
&) | |
| 212 { | |
| 213 // Clippers are always applied using stateful methods. | |
| 214 ASSERT_NOT_REACHED(); | |
| 215 } | |
| 216 | |
| 217 void RenderSVGResourceClipper::postApplyStatefulResource(RenderObject*, Graphics
Context*& context, ClipperState& clipperState) | 204 void RenderSVGResourceClipper::postApplyStatefulResource(RenderObject*, Graphics
Context*& context, ClipperState& clipperState) |
| 218 { | 205 { |
| 219 switch (clipperState) { | 206 switch (clipperState) { |
| 220 case ClipperAppliedPath: | 207 case ClipperAppliedPath: |
| 221 // Path-only clipping, no layers to restore. | 208 // Path-only clipping, no layers to restore. |
| 222 break; | 209 break; |
| 223 case ClipperAppliedMask: | 210 case ClipperAppliedMask: |
| 224 // Transfer content layer -> mask layer (SrcIn) | 211 // Transfer content layer -> mask layer (SrcIn) |
| 225 context->endLayer(); | 212 context->endLayer(); |
| 226 // Transfer mask layer -> bg layer (SrcOver) | 213 // Transfer mask layer -> bg layer (SrcOver) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 AffineTransform transform; | 358 AffineTransform transform; |
| 372 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 359 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
| 373 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 360 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
| 374 return transform.mapRect(m_clipBoundaries); | 361 return transform.mapRect(m_clipBoundaries); |
| 375 } | 362 } |
| 376 | 363 |
| 377 return m_clipBoundaries; | 364 return m_clipBoundaries; |
| 378 } | 365 } |
| 379 | 366 |
| 380 } | 367 } |
| OLD | NEW |