| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ASSERT(svgStyle); | 112 ASSERT(svgStyle); |
| 113 | 113 |
| 114 // Setup transparency layers before setting up SVG resources! | 114 // Setup transparency layers before setting up SVG resources! |
| 115 bool isRenderingMask = isRenderingMaskImage(m_object); | 115 bool isRenderingMask = isRenderingMaskImage(m_object); |
| 116 float opacity = isRenderingMask ? 1 : style->opacity(); | 116 float opacity = isRenderingMask ? 1 : style->opacity(); |
| 117 bool hasBlendMode = style->hasBlendMode() && !isRenderingMask; | 117 bool hasBlendMode = style->hasBlendMode() && !isRenderingMask; |
| 118 | 118 |
| 119 if (opacity < 1 || hasBlendMode || style->hasIsolation()) { | 119 if (opacity < 1 || hasBlendMode || style->hasIsolation()) { |
| 120 FloatRect repaintRect = m_object->repaintRectInLocalCoordinates(); | 120 FloatRect repaintRect = m_object->repaintRectInLocalCoordinates(); |
| 121 m_paintInfo->context->clip(repaintRect); | 121 m_paintInfo->context->clip(repaintRect); |
| 122 |
| 122 if (hasBlendMode) { | 123 if (hasBlendMode) { |
| 123 if (!(m_renderingFlags & RestoreGraphicsContext)) { | 124 if (!(m_renderingFlags & RestoreGraphicsContext)) { |
| 124 m_paintInfo->context->save(); | 125 m_paintInfo->context->save(); |
| 125 m_renderingFlags |= RestoreGraphicsContext; | 126 m_renderingFlags |= RestoreGraphicsContext; |
| 126 } | 127 } |
| 127 m_paintInfo->context->setCompositeOperation(CompositeSourceOver, sty
le->blendMode()); | 128 m_paintInfo->context->setCompositeOperation(CompositeSourceOver, sty
le->blendMode()); |
| 128 } | 129 } |
| 130 |
| 129 m_paintInfo->context->beginTransparencyLayer(opacity); | 131 m_paintInfo->context->beginTransparencyLayer(opacity); |
| 132 |
| 133 if (hasBlendMode) |
| 134 m_paintInfo->context->setCompositeOperation(CompositeSourceOver, bli
nk::WebBlendModeNormal); |
| 135 |
| 130 m_renderingFlags |= EndOpacityLayer; | 136 m_renderingFlags |= EndOpacityLayer; |
| 131 } | 137 } |
| 132 | 138 |
| 133 ClipPathOperation* clipPathOperation = style->clipPath(); | 139 ClipPathOperation* clipPathOperation = style->clipPath(); |
| 134 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::SHA
PE) { | 140 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::SHA
PE) { |
| 135 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPathOper
ation); | 141 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPathOper
ation); |
| 136 m_paintInfo->context->clipPath(clipPath->path(object->objectBoundingBox(
)), clipPath->windRule()); | 142 m_paintInfo->context->clipPath(clipPath->path(object->objectBoundingBox(
)), clipPath->windRule()); |
| 137 } | 143 } |
| 138 | 144 |
| 139 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
m_object); | 145 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
m_object); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 299 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); |
| 294 } else | 300 } else |
| 295 return false; | 301 return false; |
| 296 } | 302 } |
| 297 | 303 |
| 298 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 304 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
| 299 return true; | 305 return true; |
| 300 } | 306 } |
| 301 | 307 |
| 302 } | 308 } |
| OLD | NEW |