| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (!applyClipIfNecessary(resources)) | 92 if (!applyClipIfNecessary(resources)) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 if (!applyMaskIfNecessary(resources)) | 95 if (!applyMaskIfNecessary(resources)) |
| 96 return; | 96 return; |
| 97 | 97 |
| 98 if (!applyFilterIfNecessary(resources)) | 98 if (!applyFilterIfNecessary(resources)) |
| 99 return; | 99 return; |
| 100 | 100 |
| 101 if (!isIsolationInstalled() && SVGRenderSupport::isIsolationRequired(m_objec
t)) | 101 if (!isIsolationInstalled() && SVGRenderSupport::isIsolationRequired(m_objec
t)) |
| 102 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo->co
ntext, m_object->displayItemClient(), m_paintInfo->context->compositeOperation()
, WebBlendModeNormal, 1, m_paintInfo->context->compositeOperation())); | 102 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo->co
ntext, m_object->displayItemClient(), m_paintInfo->context->compositeOperationDe
precated(), WebBlendModeNormal, 1, m_paintInfo->context->compositeOperationDepre
cated())); |
| 103 | 103 |
| 104 m_renderingFlags |= RenderingPrepared; | 104 m_renderingFlags |= RenderingPrepared; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void SVGRenderingContext::applyCompositingIfNecessary() | 107 void SVGRenderingContext::applyCompositingIfNecessary() |
| 108 { | 108 { |
| 109 ASSERT(!m_paintInfo->isRenderingClipPathAsMaskImage()); | 109 ASSERT(!m_paintInfo->isRenderingClipPathAsMaskImage()); |
| 110 | 110 |
| 111 // RenderLayer takes care of root opacity and blend mode. | 111 // RenderLayer takes care of root opacity and blend mode. |
| 112 if (m_object->isSVGRoot()) | 112 if (m_object->isSVGRoot()) |
| 113 return; | 113 return; |
| 114 | 114 |
| 115 RenderStyle* style = m_object->style(); | 115 RenderStyle* style = m_object->style(); |
| 116 ASSERT(style); | 116 ASSERT(style); |
| 117 float opacity = style->opacity(); | 117 float opacity = style->opacity(); |
| 118 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed(); | 118 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed(); |
| 119 if (opacity < 1 || hasBlendMode) { | 119 if (opacity < 1 || hasBlendMode) { |
| 120 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo->context, m
_object->displayItemClient(), m_paintInfo->phase, m_object->paintInvalidationRec
tInLocalCoordinates())); | 120 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo->context, m
_object->displayItemClient(), m_paintInfo->phase, m_object->paintInvalidationRec
tInLocalCoordinates())); |
| 121 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod
eNormal; | 121 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod
eNormal; |
| 122 CompositeOperator compositeOp = hasBlendMode ? CompositeSourceOver : m_p
aintInfo->context->compositeOperation(); | 122 CompositeOperator compositeOp = hasBlendMode ? CompositeSourceOver : m_p
aintInfo->context->compositeOperationDeprecated(); |
| 123 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo->co
ntext, m_object->displayItemClient(), compositeOp, blendMode, opacity, composite
Op)); | 123 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo->co
ntext, m_object->displayItemClient(), compositeOp, blendMode, opacity, composite
Op)); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool SVGRenderingContext::applyClipIfNecessary(SVGResources* resources) | 127 bool SVGRenderingContext::applyClipIfNecessary(SVGResources* resources) |
| 128 { | 128 { |
| 129 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas | 129 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas |
| 130 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. | 130 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. |
| 131 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. | 131 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. |
| 132 if (RenderSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { | 132 if (RenderSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 { | 256 { |
| 257 ASSERT(context); | 257 ASSERT(context); |
| 258 ASSERT(item); | 258 ASSERT(item); |
| 259 ASSERT(!item->needsLayout()); | 259 ASSERT(!item->needsLayout()); |
| 260 | 260 |
| 261 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground,
PaintBehaviorNormal); | 261 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground,
PaintBehaviorNormal); |
| 262 item->paint(info, IntPoint()); | 262 item->paint(info, IntPoint()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |