| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 WebCoreCompositeToSkiaComposite(CompositeSourceOver, blendMode), opa
city, &compositingBounds)); | 119 WebCoreCompositeToSkiaComposite(CompositeSourceOver, blendMode), opa
city, &compositingBounds)); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) | 123 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) |
| 124 { | 124 { |
| 125 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas | 125 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas |
| 126 // m_object.style()->clipPath() corresponds to '-webkit-clip-path'. | 126 // m_object.style()->clipPath() corresponds to '-webkit-clip-path'. |
| 127 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. | 127 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. |
| 128 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { | 128 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { |
| 129 if (!SVGClipPainter(*clipper).prepareEffect(m_object, m_object.objectBou
ndingBox(), m_object.paintInvalidationRectInLocalSVGCoordinates(), paintInfo().c
ontext, m_clipperState)) | 129 if (!SVGClipPainter(*clipper).prepareEffect(m_object, m_object.objectBou
ndingBox(), |
| 130 m_object.paintInvalidationRectInLocalSVGCoordinates(), FloatPoint(),
paintInfo().context, m_clipperState)) |
| 130 return false; | 131 return false; |
| 131 m_clipper = clipper; | 132 m_clipper = clipper; |
| 132 } else { | 133 } else { |
| 133 ClipPathOperation* clipPathOperation = m_object.style()->clipPath(); | 134 ClipPathOperation* clipPathOperation = m_object.style()->clipPath(); |
| 134 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation:
:SHAPE) { | 135 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation:
:SHAPE) { |
| 135 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath
Operation); | 136 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath
Operation); |
| 136 if (!clipPath->isValid()) | 137 if (!clipPath->isValid()) |
| 137 return false; | 138 return false; |
| 138 m_clipPathRecorder = wrapUnique(new ClipPathRecorder(paintInfo().con
text, m_object, clipPath->path(m_object.objectBoundingBox()))); | 139 m_clipPathRecorder = wrapUnique(new ClipPathRecorder(paintInfo().con
text, m_object, clipPath->path(m_object.objectBoundingBox()))); |
| 139 } | 140 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // though. | 230 // though. |
| 230 // Additionally, it's not really safe/guaranteed to be correct, as | 231 // Additionally, it's not really safe/guaranteed to be correct, as |
| 231 // something down the paint pipe may want to farther tweak the color | 232 // something down the paint pipe may want to farther tweak the color |
| 232 // filter, which could yield incorrect results. (Consider just using | 233 // filter, which could yield incorrect results. (Consider just using |
| 233 // saveLayer() w/ this color filter explicitly instead.) | 234 // saveLayer() w/ this color filter explicitly instead.) |
| 234 paint.setColorFilter(sk_ref_sp(paintInfo.context.colorFilter())); | 235 paint.setColorFilter(sk_ref_sp(paintInfo.context.colorFilter())); |
| 235 return true; | 236 return true; |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |