| 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 |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 #include "core/rendering/svg/SVGRenderingContext.h" | 26 #include "core/rendering/svg/SVGRenderingContext.h" |
| 27 | 27 |
| 28 #include "core/frame/FrameHost.h" | 28 #include "core/frame/FrameHost.h" |
| 29 #include "core/layout/Layer.h" |
| 29 #include "core/paint/RenderDrawingRecorder.h" | 30 #include "core/paint/RenderDrawingRecorder.h" |
| 30 #include "core/rendering/PaintInfo.h" | 31 #include "core/rendering/PaintInfo.h" |
| 31 #include "core/rendering/RenderLayer.h" | |
| 32 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 32 #include "core/rendering/svg/RenderSVGResourceFilter.h" |
| 33 #include "core/rendering/svg/RenderSVGResourceMasker.h" | 33 #include "core/rendering/svg/RenderSVGResourceMasker.h" |
| 34 #include "core/rendering/svg/SVGRenderSupport.h" | 34 #include "core/rendering/svg/SVGRenderSupport.h" |
| 35 #include "core/rendering/svg/SVGResources.h" | 35 #include "core/rendering/svg/SVGResources.h" |
| 36 #include "core/rendering/svg/SVGResourcesCache.h" | 36 #include "core/rendering/svg/SVGResourcesCache.h" |
| 37 #include "platform/FloatConversion.h" | 37 #include "platform/FloatConversion.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 SVGRenderingContext::~SVGRenderingContext() | 41 SVGRenderingContext::~SVGRenderingContext() |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (!isIsolationInstalled() && SVGRenderSupport::isIsolationRequired(m_objec
t)) | 99 if (!isIsolationInstalled() && SVGRenderSupport::isIsolationRequired(m_objec
t)) |
| 100 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con
text, m_object->displayItemClient(), m_paintInfo.context->compositeOperationDepr
ecated(), WebBlendModeNormal, 1, m_paintInfo.context->compositeOperationDeprecat
ed())); | 100 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con
text, m_object->displayItemClient(), m_paintInfo.context->compositeOperationDepr
ecated(), WebBlendModeNormal, 1, m_paintInfo.context->compositeOperationDeprecat
ed())); |
| 101 | 101 |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void SVGRenderingContext::applyCompositingIfNecessary() | 105 void SVGRenderingContext::applyCompositingIfNecessary() |
| 106 { | 106 { |
| 107 ASSERT(!m_paintInfo.isRenderingClipPathAsMaskImage()); | 107 ASSERT(!m_paintInfo.isRenderingClipPathAsMaskImage()); |
| 108 | 108 |
| 109 // RenderLayer takes care of root opacity and blend mode. | 109 // Layer takes care of root opacity and blend mode. |
| 110 if (m_object->isSVGRoot()) | 110 if (m_object->isSVGRoot()) |
| 111 return; | 111 return; |
| 112 | 112 |
| 113 RenderStyle* style = m_object->style(); | 113 RenderStyle* style = m_object->style(); |
| 114 ASSERT(style); | 114 ASSERT(style); |
| 115 float opacity = style->opacity(); | 115 float opacity = style->opacity(); |
| 116 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed(); | 116 bool hasBlendMode = style->hasBlendMode() && m_object->isBlendingAllowed(); |
| 117 if (opacity < 1 || hasBlendMode) { | 117 if (opacity < 1 || hasBlendMode) { |
| 118 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo.context, m_
object->displayItemClient(), m_paintInfo.phase, m_object->paintInvalidationRectI
nLocalCoordinates())); | 118 m_clipRecorder = adoptPtr(new FloatClipRecorder(*m_paintInfo.context, m_
object->displayItemClient(), m_paintInfo.phase, m_object->paintInvalidationRectI
nLocalCoordinates())); |
| 119 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod
eNormal; | 119 WebBlendMode blendMode = hasBlendMode ? style->blendMode() : WebBlendMod
eNormal; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 while (renderer) { | 219 while (renderer) { |
| 220 ctm = renderer->localToParentTransform() * ctm; | 220 ctm = renderer->localToParentTransform() * ctm; |
| 221 if (renderer->isSVGRoot()) | 221 if (renderer->isSVGRoot()) |
| 222 break; | 222 break; |
| 223 renderer = renderer->parent(); | 223 renderer = renderer->parent(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Continue walking up the layer tree, accumulating CSS transforms. | 226 // Continue walking up the layer tree, accumulating CSS transforms. |
| 227 // FIXME: this queries layer compositing state - which is not | 227 // FIXME: this queries layer compositing state - which is not |
| 228 // supported during layout. Hence, the result may not include all CSS transf
orms. | 228 // supported during layout. Hence, the result may not include all CSS transf
orms. |
| 229 RenderLayer* layer = renderer ? renderer->enclosingLayer() : 0; | 229 Layer* layer = renderer ? renderer->enclosingLayer() : 0; |
| 230 while (layer && layer->isAllowedToQueryCompositingState()) { | 230 while (layer && layer->isAllowedToQueryCompositingState()) { |
| 231 // We can stop at compositing layers, to match the backing resolution. | 231 // We can stop at compositing layers, to match the backing resolution. |
| 232 // FIXME: should we be computing the transform to the nearest composited
layer, | 232 // FIXME: should we be computing the transform to the nearest composited
layer, |
| 233 // or the nearest composited layer that does not paint into its ancestor
? | 233 // or the nearest composited layer that does not paint into its ancestor
? |
| 234 // I think this is the nearest composited ancestor since we will inherit
its | 234 // I think this is the nearest composited ancestor since we will inherit
its |
| 235 // transforms in the composited layer tree. | 235 // transforms in the composited layer tree. |
| 236 if (layer->compositingState() != NotComposited) | 236 if (layer->compositingState() != NotComposited) |
| 237 break; | 237 break; |
| 238 | 238 |
| 239 if (TransformationMatrix* layerTransform = layer->transform()) | 239 if (TransformationMatrix* layerTransform = layer->transform()) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 251 { | 251 { |
| 252 ASSERT(context); | 252 ASSERT(context); |
| 253 ASSERT(item); | 253 ASSERT(item); |
| 254 ASSERT(!item->needsLayout()); | 254 ASSERT(!item->needsLayout()); |
| 255 | 255 |
| 256 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground,
PaintBehaviorNormal); | 256 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground,
PaintBehaviorNormal); |
| 257 item->paint(info, IntPoint()); | 257 item->paint(info, IntPoint()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace blink | 260 } // namespace blink |
| OLD | NEW |