Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 58 |
| 59 if (m_masker) { | 59 if (m_masker) { |
| 60 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); | 60 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); |
| 61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask er() == m_masker); | 61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask er() == m_masker); |
| 62 SVGMaskPainter(*m_masker).finishEffect(m_object, m_paintInfo.context); | 62 SVGMaskPainter(*m_masker).finishEffect(m_object, m_paintInfo.context); |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (m_clipper) { | 65 if (m_clipper) { |
| 66 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); | 66 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); |
| 67 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip per() == m_clipper); | 67 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip per() == m_clipper); |
| 68 SVGClipPainter(*m_clipper).postApplyStatefulResource(m_object, m_paintIn fo.context, m_clipperState); | 68 ASSERT(m_object); |
|
fs
2015/03/24 14:15:31
SVGPaintContext actually gets a reference (which i
Erik Dahlström (inactive)
2015/03/24 16:26:00
Done.
| |
| 69 SVGClipPainter(*m_clipper).postApplyStatefulResource(*m_object, m_paintI nfo.context, m_clipperState); | |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() | 73 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() |
| 73 { | 74 { |
| 74 #if ENABLE(ASSERT) | 75 #if ENABLE(ASSERT) |
| 75 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled); | 76 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled); |
| 76 m_applyClipMaskAndFilterIfNecessaryCalled = true; | 77 m_applyClipMaskAndFilterIfNecessaryCalled = true; |
| 77 #endif | 78 #endif |
| 78 | 79 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), WebCoreCompositeToSkiaComposite(compositeOp , blendMode), opacity)); | 122 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), WebCoreCompositeToSkiaComposite(compositeOp , blendMode), opacity)); |
| 122 } | 123 } |
| 123 } | 124 } |
| 124 | 125 |
| 125 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) | 126 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) |
| 126 { | 127 { |
| 127 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas | 128 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas |
| 128 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. | 129 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. |
| 129 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. | 130 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. |
| 130 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n ullptr) { | 131 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n ullptr) { |
| 131 if (!SVGClipPainter(*clipper).applyStatefulResource(m_object, m_paintInf o.context, m_clipperState)) | 132 ASSERT(m_object); |
|
fs
2015/03/24 14:15:31
Like above.
Erik Dahlström (inactive)
2015/03/24 16:26:00
Done.
| |
| 133 if (!SVGClipPainter(*clipper).applyStatefulResource(*m_object, m_paintIn fo.context, m_clipperState)) | |
| 132 return false; | 134 return false; |
| 133 m_clipper = clipper; | 135 m_clipper = clipper; |
| 134 } else { | 136 } else { |
| 135 ClipPathOperation* clipPathOperation = m_object->style()->clipPath(); | 137 ClipPathOperation* clipPathOperation = m_object->style()->clipPath(); |
| 136 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation: :SHAPE) { | 138 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation: :SHAPE) { |
| 137 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath Operation); | 139 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath Operation); |
| 138 if (!clipPath->isValid()) | 140 if (!clipPath->isValid()) |
| 139 return false; | 141 return false; |
| 140 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont ext, m_object->displayItemClient(), clipPath->path(m_object->objectBoundingBox() ), clipPath->windRule())); | 142 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont ext, m_object->displayItemClient(), clipPath->path(m_object->objectBoundingBox() ), clipPath->windRule())); |
| 141 } | 143 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 { | 193 { |
| 192 ASSERT(context); | 194 ASSERT(context); |
| 193 ASSERT(item); | 195 ASSERT(item); |
| 194 ASSERT(!item->needsLayout()); | 196 ASSERT(!item->needsLayout()); |
| 195 | 197 |
| 196 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal); | 198 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal); |
| 197 item->paint(info, IntPoint()); | 199 item->paint(info, IntPoint()); |
| 198 } | 200 } |
| 199 | 201 |
| 200 } // namespace blink | 202 } // namespace blink |
| OLD | NEW |