Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: third_party/WebKit/Source/core/paint/SVGPaintContext.cpp

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, GlobalPaintNormalPhase, PaintLayerNoFlag); 187 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, GlobalPaintNormalPhase, PaintLayerNoFlag);
188 item->paint(info, IntPoint()); 188 item->paint(info, IntPoint());
189 } 189 }
190 190
191 bool SVGPaintContext::paintForLayoutObject(const PaintInfo& paintInfo, const Com putedStyle& style, const LayoutObject& layoutObject, LayoutSVGResourceMode resou rceMode, SkPaint& paint, const AffineTransform* additionalPaintServerTransform) 191 bool SVGPaintContext::paintForLayoutObject(const PaintInfo& paintInfo, const Com putedStyle& style, const LayoutObject& layoutObject, LayoutSVGResourceMode resou rceMode, SkPaint& paint, const AffineTransform* additionalPaintServerTransform)
192 { 192 {
193 if (paintInfo.isRenderingClipPathAsMaskImage()) { 193 if (paintInfo.isRenderingClipPathAsMaskImage()) {
194 if (resourceMode == ApplyToStrokeMode) 194 if (resourceMode == ApplyToStrokeMode)
195 return false; 195 return false;
196 paint.setColor(SVGComputedStyle::initialFillPaintColor().rgb()); 196 paint.setColor(Color::toDeviceColor(SVGComputedStyle::initialFillPaintCo lor()).rgb());
197 paint.setShader(nullptr); 197 paint.setShader(nullptr);
198 return true; 198 return true;
199 } 199 }
200 200
201 SVGPaintServer paintServer = SVGPaintServer::requestForLayoutObject(layoutOb ject, style, resourceMode); 201 SVGPaintServer paintServer = SVGPaintServer::requestForLayoutObject(layoutOb ject, style, resourceMode);
202 if (!paintServer.isValid()) 202 if (!paintServer.isValid())
203 return false; 203 return false;
204 204
205 if (additionalPaintServerTransform && paintServer.isTransformDependent()) 205 if (additionalPaintServerTransform && paintServer.isTransformDependent())
206 paintServer.prependTransform(*additionalPaintServerTransform); 206 paintServer.prependTransform(*additionalPaintServerTransform);
(...skipping 15 matching lines...) Expand all
222 // though. 222 // though.
223 // Additionally, it's not really safe/guaranteed to be correct, as 223 // Additionally, it's not really safe/guaranteed to be correct, as
224 // something down the paint pipe may want to farther tweak the color 224 // something down the paint pipe may want to farther tweak the color
225 // filter, which could yield incorrect results. (Consider just using 225 // filter, which could yield incorrect results. (Consider just using
226 // saveLayer() w/ this color filter explicitly instead.) 226 // saveLayer() w/ this color filter explicitly instead.)
227 paint.setColorFilter(paintInfo.context.colorFilter()); 227 paint.setColorFilter(paintInfo.context.colorFilter());
228 return true; 228 return true;
229 } 229 }
230 230
231 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698