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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 if (m_masker) { | 54 if (m_masker) { |
55 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); | 55 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); |
56 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask
er() == m_masker); | 56 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask
er() == m_masker); |
57 SVGMaskPainter(*m_masker).finishEffect(*m_object, m_paintInfo.context); | 57 SVGMaskPainter(*m_masker).finishEffect(*m_object, m_paintInfo.context); |
58 } | 58 } |
59 | 59 |
60 if (m_clipper) { | 60 if (m_clipper) { |
61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); | 61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); |
62 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip
per() == m_clipper); | 62 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip
per() == m_clipper); |
63 SVGClipPainter(*m_clipper).postApplyStatefulResource(*m_object, m_paintI
nfo.context, m_clipperState); | 63 SVGClipPainter(*m_clipper).finishEffect(*m_object, m_paintInfo.context,
m_clipperState); |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() | 67 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() |
68 { | 68 { |
69 #if ENABLE(ASSERT) | 69 #if ENABLE(ASSERT) |
70 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled); | 70 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled); |
71 m_applyClipMaskAndFilterIfNecessaryCalled = true; | 71 m_applyClipMaskAndFilterIfNecessaryCalled = true; |
72 #endif | 72 #endif |
73 | 73 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 WebCoreCompositeToSkiaComposite(CompositeSourceOver, blendMode), opa
city, &compositingBounds)); | 116 WebCoreCompositeToSkiaComposite(CompositeSourceOver, blendMode), opa
city, &compositingBounds)); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) | 120 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) |
121 { | 121 { |
122 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas | 122 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas |
123 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. | 123 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. |
124 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. | 124 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. |
125 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { | 125 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n
ullptr) { |
126 if (!SVGClipPainter(*clipper).applyStatefulResource(*m_object, m_paintIn
fo.context, m_clipperState)) | 126 if (!SVGClipPainter(*clipper).prepareEffect(*m_object, m_object->objectB
oundingBox(), m_object->paintInvalidationRectInLocalCoordinates(), m_paintInfo.c
ontext, m_clipperState)) |
127 return false; | 127 return false; |
128 m_clipper = clipper; | 128 m_clipper = clipper; |
129 } else { | 129 } else { |
130 ClipPathOperation* clipPathOperation = m_object->style()->clipPath(); | 130 ClipPathOperation* clipPathOperation = m_object->style()->clipPath(); |
131 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation:
:SHAPE) { | 131 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation:
:SHAPE) { |
132 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath
Operation); | 132 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath
Operation); |
133 if (!clipPath->isValid()) | 133 if (!clipPath->isValid()) |
134 return false; | 134 return false; |
135 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont
ext, *m_object, clipPath->path(m_object->objectBoundingBox()))); | 135 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont
ext, *m_object, clipPath->path(m_object->objectBoundingBox()))); |
136 } | 136 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // though. | 227 // though. |
228 // Additionally, it's not really safe/guaranteed to be correct, as | 228 // Additionally, it's not really safe/guaranteed to be correct, as |
229 // something down the paint pipe may want to farther tweak the color | 229 // something down the paint pipe may want to farther tweak the color |
230 // filter, which could yield incorrect results. (Consider just using | 230 // filter, which could yield incorrect results. (Consider just using |
231 // saveLayer() w/ this color filter explicitly instead.) | 231 // saveLayer() w/ this color filter explicitly instead.) |
232 paint.setColorFilter(paintInfo.context->colorFilter()); | 232 paint.setColorFilter(paintInfo.context->colorFilter()); |
233 return true; | 233 return true; |
234 } | 234 } |
235 | 235 |
236 } // namespace blink | 236 } // namespace blink |
OLD | NEW |