<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169225] branches/safari-537.77-branch/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169225">169225</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2014-05-22 15:43:07 -0700 (Thu, 22 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/166741">r166741</a>. <rdar://problem/16975484></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari53777branchSourceWebCoreChangeLog">branches/safari-537.77-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreWebCoreexpin">branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#branchessafari53777branchSourceWebCorecssCSSComputedStyleDeclarationcpp">branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorecssStyleResolvercpp">branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicscaPlatformCAFiltersh">branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm">branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationcpp">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationh">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationscpp">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorerenderingFilterEffectRenderercpp">branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorerenderingRenderLayerFilterInfocpp">branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp">branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari53777branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/ChangeLog (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/ChangeLog        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/ChangeLog        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2014-05-22 Lucas Forschler <lforschler@apple.com>
+
+ Merge r166741
+
+ 2014-04-02 Simon Fraser <simon.fraser@apple.com>
+
+ Harden FilterOperation type casting
+ https://bugs.webkit.org/show_bug.cgi?id=131142
+
+ Reviewed by Sam Weinig.
+
+ DefaultFilterOperation had an error-prone behavior where it set the base class
+ OperationType to the type of some other filter class, but overrode isDefault().
+ This made it very easy to write incorrect code that casted incorrectly based on type().
+
+ Fix by making adding a DEFAULT filter operation type, and storing the represented
+ type on DefaultFilterOperation().
+
+ Also remove the OperationType argument for constructors of FilterOperations that
+ can only be of one type, to avoid possible mistakes.
+
+ Make the type cast macros a bit more normal, and use them in a few places.
+
+ Fixed PlatformCAFiltersMac to handle the default filter case more cleanly.
+
+ * WebCore.exp.in:
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::valueForFilter):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::createFilterOperations):
+ * platform/graphics/ca/PlatformCAFilters.h:
+ * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
+ (PlatformCAFilters::filterValueForOperation):
+ (PlatformCAFilters::colorMatrixValueForFilter):
+ * platform/graphics/filters/FilterOperation.cpp:
+ (WebCore::DefaultFilterOperation::operator==):
+ (WebCore::ReferenceFilterOperation::ReferenceFilterOperation):
+ (WebCore::ReferenceFilterOperation::operator==):
+ (WebCore::BlurFilterOperation::operator==):
+ (WebCore::BlurFilterOperation::blend):
+ (WebCore::DropShadowFilterOperation::operator==):
+ (WebCore::DropShadowFilterOperation::blend):
+ * platform/graphics/filters/FilterOperation.h:
+ (WebCore::FilterOperation::blend):
+ (WebCore::FilterOperation::type):
+ (WebCore::FilterOperation::isBasicColorMatrixFilterOperation):
+ (WebCore::FilterOperation::isBasicComponentTransferFilterOperation):
+ (WebCore::FilterOperation::isSameType):
+ (WebCore::DefaultFilterOperation::create):
+ (WebCore::DefaultFilterOperation::representedType):
+ (WebCore::DefaultFilterOperation::DefaultFilterOperation):
+ (WebCore::ReferenceFilterOperation::create):
+ (WebCore::BlurFilterOperation::create):
+ (WebCore::BlurFilterOperation::BlurFilterOperation):
+ (WebCore::DropShadowFilterOperation::create):
+ (WebCore::DropShadowFilterOperation::DropShadowFilterOperation):
+ (WebCore::FilterOperation::isDefault): Deleted.
+ * platform/graphics/filters/FilterOperations.cpp:
+ (WebCore::FilterOperations::outsets):
+ * rendering/FilterEffectRenderer.cpp:
+ (WebCore::FilterEffectRenderer::build):
+ * rendering/RenderLayerFilterInfo.cpp:
+ (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
+
</ins><span class="cx"> 2014-05-22 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r167851
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -788,6 +788,7 @@
</span><span class="cx"> __ZN7WebCore24FrameDestructionObserverC2EPNS_5FrameE
</span><span class="cx"> __ZN7WebCore24FrameDestructionObserverD2Ev
</span><span class="cx"> __ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_19ParserContentPolicyE
</span><ins>+__ZN7WebCore24ReferenceFilterOperationC1ERKN3WTF6StringES4_
</ins><span class="cx"> __ZN7WebCore24decodeURLEscapeSequencesERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore24deleteCookiesForHostnameERKNS_21NetworkStorageSessionERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore24fileSystemRepresentationERKN3WTF6StringE
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -917,67 +917,67 @@
</span><span class="cx"> FilterOperation* filterOperation = (*it).get();
</span><span class="cx"> switch (filterOperation->getOperationType()) {
</span><span class="cx"> case FilterOperation::REFERENCE: {
</span><del>- ReferenceFilterOperation* referenceOperation = static_cast<ReferenceFilterOperation*>(filterOperation);
</del><ins>+ ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(referenceOperation->url(), CSSPrimitiveValue::CSS_STRING));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::GRAYSCALE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::GrayscaleFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SEPIA: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SepiaFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SATURATE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SaturateFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::HUE_ROTATE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::HueRotateFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(colorMatrixOperation->amount(), CSSPrimitiveValue::CSS_DEG));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::INVERT: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::InvertFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(componentTransferOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::OPACITY: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::OpacityFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(componentTransferOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BRIGHTNESS: {
</span><del>- BasicComponentTransferFilterOperation* brightnessOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* brightnessOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BrightnessFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(brightnessOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::CONTRAST: {
</span><del>- BasicComponentTransferFilterOperation* contrastOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* contrastOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ContrastFilterOperation);
</span><span class="cx"> filterValue->append(cssValuePool().createValue(contrastOperation->amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BLUR: {
</span><del>- BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation*>(filterOperation);
</del><ins>+ BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BlurFilterOperation);
</span><span class="cx"> filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviation().value(), style));
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::DROP_SHADOW: {
</span><del>- DropShadowFilterOperation* dropShadowOperation = static_cast<DropShadowFilterOperation*>(filterOperation);
</del><ins>+ DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx"> filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::DropShadowFilterOperation);
</span><span class="cx"> // We want our computed style to look like that of a text shadow (has neither spread nor inset style).
</span><span class="cx"> ShadowData shadowData = ShadowData(dropShadowOperation->location(), dropShadowOperation->stdDeviation(), 0, Normal, false, dropShadowOperation->color());
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -3931,7 +3931,7 @@
</span><span class="cx"> WebKitCSSSVGDocumentValue* svgDocumentValue = static_cast<WebKitCSSSVGDocumentValue*>(argument);
</span><span class="cx"> KURL url = m_state.document()->completeURL(svgDocumentValue->url());
</span><span class="cx">
</span><del>- RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), url.fragmentIdentifier(), operationType);
</del><ins>+ RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), url.fragmentIdentifier());
</ins><span class="cx"> if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), m_state.document())) {
</span><span class="cx"> if (!svgDocumentValue->loadRequested())
</span><span class="cx"> m_state.pendingSVGDocuments().set(operation.get(), svgDocumentValue);
</span><span class="lines">@@ -4001,7 +4001,7 @@
</span><span class="cx"> if (stdDeviation.isUndefined())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- operations.operations().append(BlurFilterOperation::create(stdDeviation, operationType));
</del><ins>+ operations.operations().append(BlurFilterOperation::create(stdDeviation));
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case WebKitCSSFilterValue::DropShadowFilterOperation: {
</span><span class="lines">@@ -4020,7 +4020,7 @@
</span><span class="cx"> if (item->color)
</span><span class="cx"> color = colorFromPrimitiveValue(item->color.get());
</span><span class="cx">
</span><del>- operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent, operationType));
</del><ins>+ operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent));
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case WebKitCSSFilterValue::UnknownFilterOperation:
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicscaPlatformCAFiltersh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -54,7 +54,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #ifdef USE_CA_FILTERS
</span><del>- static RetainPtr<NSValue> colorMatrixValueForFilter(const FilterOperation&);
</del><ins>+ // A null operation indicates that we should make a "no-op" filter of the given type.
+ static RetainPtr<NSValue> colorMatrixValueForFilter(FilterOperation::OperationType, const FilterOperation*);
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -108,6 +108,9 @@
</span><span class="cx"> String filterName = String::format("filter_%d", i);
</span><span class="cx"> const FilterOperation* filterOperation = filters.at(i);
</span><span class="cx"> switch (filterOperation->getOperationType()) {
</span><ins>+ case FilterOperation::DEFAULT:
+ ASSERT_NOT_REACHED();
+ break;
</ins><span class="cx"> case FilterOperation::DROP_SHADOW: {
</span><span class="cx"> // FIXME: For now assume drop shadow is the last filter, put it on the layer.
</span><span class="cx"> // <rdar://problem/10959969> Handle case where drop-shadow is not the last filter.
</span><span class="lines">@@ -133,7 +136,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SEPIA: {
</span><del>- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation->getOperationType(), filterOperation);
</ins><span class="cx"> CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx"> [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
</span><span class="cx"> [filter setName:filterName];
</span><span class="lines">@@ -158,7 +161,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::INVERT: {
</span><del>- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation->getOperationType(), filterOperation);
</ins><span class="cx"> CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx"> [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
</span><span class="cx"> [filter setName:filterName];
</span><span class="lines">@@ -166,7 +169,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::OPACITY: {
</span><del>- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation->getOperationType(), filterOperation);
</ins><span class="cx"> CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx"> [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
</span><span class="cx"> [filter setName:filterName];
</span><span class="lines">@@ -174,7 +177,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BRIGHTNESS: {
</span><del>- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation->getOperationType(), filterOperation);
</ins><span class="cx"> CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx"> [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
</span><span class="cx"> [filter setName:filterName];
</span><span class="lines">@@ -182,7 +185,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::CONTRAST: {
</span><del>- RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+ RetainPtr<NSValue> colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation->getOperationType(), filterOperation);
</ins><span class="cx"> CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx"> [filter setValue:colorMatrixValue.get() forKey:@"inputColorMatrix"];
</span><span class="cx"> [filter setName:filterName];
</span><span class="lines">@@ -334,26 +337,33 @@
</span><span class="cx"> FilterOperation::OperationType type = operation->getOperationType();
</span><span class="cx"> RetainPtr<id> value;
</span><span class="cx">
</span><ins>+ if (type == FilterOperation::DEFAULT) {
+ type = toDefaultFilterOperation(operation)->representedType();
+ operation = nullptr;
+ }
+
</ins><span class="cx"> switch (type) {
</span><ins>+ case FilterOperation::DEFAULT:
+ ASSERT_NOT_REACHED();
+ break;
</ins><span class="cx"> case FilterOperation::GRAYSCALE: {
</span><span class="cx"> // CIFilter: inputIntensity
</span><span class="cx"> // CAFilter: inputAmount
</span><span class="cx"> double amount = 0;
</span><del>- if (!operation->isDefault()) {
- const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
- amount = op->amount();
- }
</del><ins>+ if (operation)
+ amount = toBasicColorMatrixFilterOperation(operation)->amount();
+
</ins><span class="cx"> value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SEPIA: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx"> // CAFilter: inputColorMatrix
</span><del>- value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx"> // CIFilter: inputRVector, inputGVector, inputBVector
</span><span class="cx"> double amount = 0;
</span><del>- if (!operation->isDefault()) {
</del><ins>+ if (operation) {
</ins><span class="cx"> const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
</span><span class="cx"> amount = op->amount();
</span><span class="cx"> }
</span><span class="lines">@@ -378,10 +388,8 @@
</span><span class="cx"> // CIFilter: inputSaturation
</span><span class="cx"> // CAFilter: inputAmount
</span><span class="cx"> double amount = 1;
</span><del>- if (!operation->isDefault()) {
- const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
- amount = op->amount();
- }
</del><ins>+ if (operation)
+ amount = toBasicColorMatrixFilterOperation(operation)->amount();
</ins><span class="cx">
</span><span class="cx"> value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> break;
</span><span class="lines">@@ -390,10 +398,9 @@
</span><span class="cx"> // Hue rotate CIFilter: inputAngle
</span><span class="cx"> // Hue rotate CAFilter: inputAngle
</span><span class="cx"> double amount = 0;
</span><del>- if (!operation->isDefault()) {
- const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
- amount = op->amount();
- }
</del><ins>+ if (operation)
+ amount = toBasicColorMatrixFilterOperation(operation)->amount();
+
</ins><span class="cx"> amount = deg2rad(amount);
</span><span class="cx"> value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> break;
</span><span class="lines">@@ -401,15 +408,13 @@
</span><span class="cx"> case FilterOperation::INVERT: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx"> // CAFilter: inputColorMatrix
</span><del>- value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx"> // CIFilter: inputRVector, inputGVector, inputBVector, inputBiasVector
</span><span class="cx"> double amount = 0;
</span><del>- if (!operation->isDefault()) {
- const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
- amount = op->amount();
- }
-
</del><ins>+ if (operation)
+ amount = toBasicComponentTransferFilterOperation(operation)->amount();
+
</ins><span class="cx"> double multiplier = 1 - amount * 2;
</span><span class="cx">
</span><span class="cx"> // The color matrix animation for invert does a scale of each color component by a value that goes from
</span><span class="lines">@@ -429,14 +434,12 @@
</span><span class="cx"> case FilterOperation::OPACITY: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx"> // Opacity CAFilter: inputColorMatrix
</span><del>- value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx"> // Opacity CIFilter: inputAVector
</span><span class="cx"> double amount = 1;
</span><del>- if (!operation->isDefault()) {
- const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
- amount = op->amount();
- }
</del><ins>+ if (operation)
+ amount = toBasicComponentTransferFilterOperation(operation)->amount();
</ins><span class="cx">
</span><span class="cx"> value = adoptNS([[CIVector alloc] initWithX:0 Y:0 Z:0 W:amount]);
</span><span class="cx"> #endif
</span><span class="lines">@@ -446,14 +449,12 @@
</span><span class="cx"> case FilterOperation::BRIGHTNESS: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx"> // Brightness CAFilter: inputColorMatrix
</span><del>- value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx"> // Brightness CIFilter: inputColorMatrix
</span><span class="cx"> double amount = 1;
</span><del>- if (!operation->isDefault()) {
- const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
- amount = op->amount();
- }
</del><ins>+ if (operation)
+ amount = toBasicComponentTransferFilterOperation(operation)->amount();
</ins><span class="cx">
</span><span class="cx"> CIVector* rowVector = 0;
</span><span class="cx"> switch (internalFilterPropertyIndex) {
</span><span class="lines">@@ -469,15 +470,13 @@
</span><span class="cx"> case FilterOperation::CONTRAST: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx"> // Contrast CAFilter: inputColorMatrix
</span><del>- value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+ value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx"> // Contrast CIFilter: inputContrast
</span><span class="cx"> double amount = 1;
</span><del>- if (!operation->isDefault()) {
- const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
- amount = op->amount();
- }
-
</del><ins>+ if (operation)
+ amount = toBasicComponentTransferFilterOperation(operation)->amount();
+
</ins><span class="cx"> value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> #endif
</span><span class="cx"> break;
</span><span class="lines">@@ -486,11 +485,8 @@
</span><span class="cx"> // CIFilter: inputRadius
</span><span class="cx"> // CAFilter: inputRadius
</span><span class="cx"> double amount = 0;
</span><del>-
- if (!operation->isDefault()) {
- const BlurFilterOperation* op = toBlurFilterOperation(operation);
- amount = floatValueForLength(op->stdDeviation(), 0);
- }
</del><ins>+ if (operation)
+ amount = floatValueForLength(toBlurFilterOperation(operation)->stdDeviation(), 0);
</ins><span class="cx">
</span><span class="cx"> value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> break;
</span><span class="lines">@@ -503,12 +499,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE_CA_FILTERS
</span><del>-RetainPtr<NSValue> PlatformCAFilters::colorMatrixValueForFilter(const FilterOperation& filterOperation)
</del><ins>+RetainPtr<NSValue> PlatformCAFilters::colorMatrixValueForFilter(FilterOperation::OperationType type, const FilterOperation* filterOperation)
</ins><span class="cx"> {
</span><del>- switch (filterOperation.getOperationType()) {
</del><ins>+ switch (type) {
</ins><span class="cx"> case FilterOperation::SEPIA: {
</span><del>- const BasicColorMatrixFilterOperation& op = toBasicColorMatrixFilterOperation(filterOperation);
- double t = op.amount();
</del><ins>+ double t = filterOperation ? toBasicColorMatrixFilterOperation(filterOperation)->amount() : 0;
</ins><span class="cx"> t = std::min(std::max(0.0, t), 1.0);
</span><span class="cx"> CAColorMatrix colorMatrix = {
</span><span class="cx"> static_cast<float>(WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)),
</span><span class="lines">@@ -527,11 +522,7 @@
</span><span class="cx"> return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::INVERT: {
</span><del>- const BasicComponentTransferFilterOperation& op = toBasicComponentTransferFilterOperation(filterOperation);
- float amount = op.amount();
- if (op.isDefault())
- amount = 0;
-
</del><ins>+ float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)->amount() : 0;
</ins><span class="cx"> float multiplier = 1 - amount * 2;
</span><span class="cx"> CAColorMatrix colorMatrix = {
</span><span class="cx"> multiplier, 0, 0, 0, amount,
</span><span class="lines">@@ -542,11 +533,7 @@
</span><span class="cx"> return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::OPACITY: {
</span><del>- const BasicComponentTransferFilterOperation& op = toBasicComponentTransferFilterOperation(filterOperation);
- float amount = op.amount();
- if (op.isDefault())
- amount = 1;
-
</del><ins>+ float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)->amount() : 1;
</ins><span class="cx"> CAColorMatrix colorMatrix = {
</span><span class="cx"> 1, 0, 0, 0, 0,
</span><span class="cx"> 0, 1, 0, 0, 0,
</span><span class="lines">@@ -556,11 +543,7 @@
</span><span class="cx"> return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::CONTRAST: {
</span><del>- const BasicComponentTransferFilterOperation& op = toBasicComponentTransferFilterOperation(filterOperation);
- float amount = op.amount();
- if (op.isDefault())
- amount = 1;
-
</del><ins>+ float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)->amount() : 1;
</ins><span class="cx"> float intercept = -0.5 * amount + 0.5;
</span><span class="cx"> CAColorMatrix colorMatrix = {
</span><span class="cx"> amount, 0, 0, 0, intercept,
</span><span class="lines">@@ -571,11 +554,7 @@
</span><span class="cx"> return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BRIGHTNESS: {
</span><del>- const BasicComponentTransferFilterOperation& op = toBasicComponentTransferFilterOperation(filterOperation);
- float amount = op.amount();
- if (op.isDefault())
- amount = 1;
-
</del><ins>+ float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)->amount() : 1;
</ins><span class="cx"> CAColorMatrix colorMatrix = {
</span><span class="cx"> amount, 0, 0, 0, 0,
</span><span class="cx"> 0, amount, 0, 0, 0,
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -35,9 +35,17 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><ins>+
+bool DefaultFilterOperation::operator==(const FilterOperation& o) const
+{
+ if (!isSameType(o))
+ return false;
+
+ return representedType() == toDefaultFilterOperation(o).representedType();
+}
</ins><span class="cx">
</span><del>-ReferenceFilterOperation::ReferenceFilterOperation(const String& url, const String& fragment, OperationType type)
- : FilterOperation(type)
</del><ins>+ReferenceFilterOperation::ReferenceFilterOperation(const String& url, const String& fragment)
+ : FilterOperation(REFERENCE)
</ins><span class="cx"> , m_url(url)
</span><span class="cx"> , m_fragment(fragment)
</span><span class="cx"> {
</span><span class="lines">@@ -46,7 +54,15 @@
</span><span class="cx"> ReferenceFilterOperation::~ReferenceFilterOperation()
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>-
</del><ins>+
+bool ReferenceFilterOperation::operator==(const FilterOperation& o) const
+{
+ if (!isSameType(o))
+ return false;
+
+ return m_url == toReferenceFilterOperation(o).m_url;
+}
+
</ins><span class="cx"> #if ENABLE(SVG)
</span><span class="cx"> void ReferenceFilterOperation::setCachedSVGDocumentReference(PassOwnPtr<CachedSVGDocumentReference> cachedSVGDocumentReference)
</span><span class="cx"> {
</span><span class="lines">@@ -127,7 +143,15 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
+bool BlurFilterOperation::operator==(const FilterOperation& o) const
+{
+ if (!isSameType(o))
+ return false;
+
+ return m_stdDeviation == toBlurFilterOperation(o).stdDeviation();
+}
+
</ins><span class="cx"> PassRefPtr<FilterOperation> BlurFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
</span><span class="cx"> {
</span><span class="cx"> if (from && !from->isSameType(*this))
</span><span class="lines">@@ -136,13 +160,21 @@
</span><span class="cx"> LengthType lengthType = m_stdDeviation.type();
</span><span class="cx">
</span><span class="cx"> if (blendToPassthrough)
</span><del>- return BlurFilterOperation::create(Length(lengthType).blend(m_stdDeviation, progress), m_type);
</del><ins>+ return BlurFilterOperation::create(Length(lengthType).blend(m_stdDeviation, progress));
</ins><span class="cx">
</span><del>- const BlurFilterOperation* fromOp = static_cast<const BlurFilterOperation*>(from);
</del><ins>+ const BlurFilterOperation* fromOp = toBlurFilterOperation(from);
</ins><span class="cx"> Length fromLength = fromOp ? fromOp->m_stdDeviation : Length(lengthType);
</span><del>- return BlurFilterOperation::create(m_stdDeviation.blend(fromLength, progress), m_type);
</del><ins>+ return BlurFilterOperation::create(m_stdDeviation.blend(fromLength, progress));
</ins><span class="cx"> }
</span><del>-
</del><ins>+
+bool DropShadowFilterOperation::operator==(const FilterOperation& o) const
+{
+ if (!isSameType(o))
+ return false;
+ const DropShadowFilterOperation& other = toDropShadowFilterOperation(o);
+ return m_location == other.m_location && m_stdDeviation == other.m_stdDeviation && m_color == other.m_color;
+}
+
</ins><span class="cx"> PassRefPtr<FilterOperation> DropShadowFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
</span><span class="cx"> {
</span><span class="cx"> if (from && !from->isSameType(*this))
</span><span class="lines">@@ -152,10 +184,9 @@
</span><span class="cx"> return DropShadowFilterOperation::create(
</span><span class="cx"> WebCore::blend(m_location, IntPoint(), progress),
</span><span class="cx"> WebCore::blend(m_stdDeviation, 0, progress),
</span><del>- WebCore::blend(m_color, Color(Color::transparent), progress),
- m_type);
</del><ins>+ WebCore::blend(m_color, Color(Color::transparent), progress));
</ins><span class="cx">
</span><del>- const DropShadowFilterOperation* fromOp = static_cast<const DropShadowFilterOperation*>(from);
</del><ins>+ const DropShadowFilterOperation* fromOp = toDropShadowFilterOperation(from);
</ins><span class="cx"> IntPoint fromLocation = fromOp ? fromOp->location() : IntPoint();
</span><span class="cx"> int fromStdDeviation = fromOp ? fromOp->stdDeviation() : 0;
</span><span class="cx"> Color fromColor = fromOp ? fromOp->color() : Color(Color::transparent);
</span><span class="lines">@@ -163,7 +194,7 @@
</span><span class="cx"> return DropShadowFilterOperation::create(
</span><span class="cx"> WebCore::blend(fromLocation, m_location, progress),
</span><span class="cx"> WebCore::blend(fromStdDeviation, m_stdDeviation, progress),
</span><del>- WebCore::blend(fromColor, m_color, progress), m_type);
</del><ins>+ WebCore::blend(fromColor, m_color, progress));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx"> * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #ifndef FilterOperation_h
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> VALIDATED_CUSTOM,
</span><span class="cx"> #endif
</span><span class="cx"> PASSTHROUGH,
</span><ins>+ DEFAULT,
</ins><span class="cx"> NONE
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -86,22 +87,31 @@
</span><span class="cx"> bool operator!=(const FilterOperation& o) const { return !(*this == o); }
</span><span class="cx">
</span><span class="cx"> virtual PassRefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, bool /*blendToPassthrough*/ = false)
</span><del>- {
</del><ins>+ {
</ins><span class="cx"> ASSERT(!blendingNeedsRendererSize());
</span><del>- return 0;
</del><ins>+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual PassRefPtr<FilterOperation> blend(const FilterOperation* /*from*/, double /*progress*/, const LayoutSize&, bool /*blendToPassthrough*/ = false)
</span><del>- {
</del><ins>+ {
</ins><span class="cx"> ASSERT(blendingNeedsRendererSize());
</span><del>- return 0;
</del><ins>+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- virtual OperationType getOperationType() const { return m_type; }
- virtual bool isSameType(const FilterOperation& o) const { return o.getOperationType() == m_type; }
-
- virtual bool isDefault() const { return false; }
</del><ins>+ OperationType getOperationType() const { return m_type; }
</ins><span class="cx">
</span><ins>+ bool isBasicColorMatrixFilterOperation() const
+ {
+ return m_type == GRAYSCALE || m_type == SEPIA || m_type == SATURATE || m_type == HUE_ROTATE;
+ }
+
+ bool isBasicComponentTransferFilterOperation() const
+ {
+ return m_type == INVERT || m_type == BRIGHTNESS || m_type == CONTRAST || m_type == OPACITY;
+ }
+
+ bool isSameType(const FilterOperation& o) const { return o.getOperationType() == m_type; }
+
</ins><span class="cx"> // True if the alpha channel of any pixel can change under this operation.
</span><span class="cx"> virtual bool affectsOpacity() const { return false; }
</span><span class="cx"> // True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
</span><span class="lines">@@ -118,28 +128,33 @@
</span><span class="cx"> OperationType m_type;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+#define FILTEROPERATION_TYPE_CASTS(ToValueTypeName, predicate) \
+ TYPE_CASTS_BASE(ToValueTypeName, WebCore::FilterOperation, value, value->predicate, value.predicate)
+
</ins><span class="cx"> class DefaultFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<DefaultFilterOperation> create(OperationType type)
</del><ins>+ static PassRefPtr<DefaultFilterOperation> create(OperationType representedType)
</ins><span class="cx"> {
</span><del>- return adoptRef(new DefaultFilterOperation(type));
</del><ins>+ return adoptRef(new DefaultFilterOperation(representedType));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ OperationType representedType() const { return m_representedType; }
+
</ins><span class="cx"> private:
</span><ins>+ virtual bool operator==(const FilterOperation&) const;
</ins><span class="cx">
</span><del>- virtual bool operator==(const FilterOperation& o) const
</del><ins>+ DefaultFilterOperation(OperationType representedType)
+ : FilterOperation(DEFAULT)
+ , m_representedType(representedType)
</ins><span class="cx"> {
</span><del>- return isSameType(o);
</del><span class="cx"> }
</span><span class="cx">
</span><del>- virtual bool isDefault() const { return true; }
-
- DefaultFilterOperation(OperationType type)
- : FilterOperation(type)
- {
- }
</del><ins>+ OperationType m_representedType;
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(DefaultFilterOperation, type() == FilterOperation::DEFAULT);
+
+
</ins><span class="cx"> class PassthroughFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<PassthroughFilterOperation> create()
</span><span class="lines">@@ -160,11 +175,13 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(PassthroughFilterOperation, type() == FilterOperation::PASSTHROUGH);
+
</ins><span class="cx"> class ReferenceFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment, OperationType type)
</del><ins>+ static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ReferenceFilterOperation(url, fragment, type));
</del><ins>+ return adoptRef(new ReferenceFilterOperation(url, fragment));
</ins><span class="cx"> }
</span><span class="cx"> ~ReferenceFilterOperation();
</span><span class="cx">
</span><span class="lines">@@ -183,15 +200,9 @@
</span><span class="cx"> void setFilterEffect(PassRefPtr<FilterEffect> filterEffect) { m_filterEffect = filterEffect; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- ReferenceFilterOperation(const String& url, const String& fragment, OperationType);
</del><ins>+ ReferenceFilterOperation(const String& url, const String& fragment);
</ins><span class="cx">
</span><del>- virtual bool operator==(const FilterOperation& o) const
- {
- if (!isSameType(o))
- return false;
- const ReferenceFilterOperation* other = static_cast<const ReferenceFilterOperation*>(&o);
- return m_url == other->m_url;
- }
</del><ins>+ virtual bool operator==(const FilterOperation&) const;
</ins><span class="cx">
</span><span class="cx"> String m_url;
</span><span class="cx"> String m_fragment;
</span><span class="lines">@@ -201,6 +212,8 @@
</span><span class="cx"> RefPtr<FilterEffect> m_filterEffect;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(ReferenceFilterOperation, type() == FilterOperation::REFERENCE);
+
</ins><span class="cx"> // GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color matrix effect.
</span><span class="cx"> // For HUE_ROTATE, the angle of rotation is stored in m_amount.
</span><span class="cx"> class BasicColorMatrixFilterOperation : public FilterOperation {
</span><span class="lines">@@ -228,6 +241,8 @@
</span><span class="cx"> double m_amount;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(BasicColorMatrixFilterOperation, isBasicColorMatrixFilterOperation());
+
</ins><span class="cx"> // INVERT, BRIGHTNESS, CONTRAST and OPACITY are variations on a basic component transfer effect.
</span><span class="cx"> class BasicComponentTransferFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><span class="lines">@@ -256,11 +271,13 @@
</span><span class="cx"> double m_amount;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(BasicComponentTransferFilterOperation, isBasicComponentTransferFilterOperation());
+
</ins><span class="cx"> class BlurFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<BlurFilterOperation> create(Length stdDeviation, OperationType type)
</del><ins>+ static PassRefPtr<BlurFilterOperation> create(Length stdDeviation)
</ins><span class="cx"> {
</span><del>- return adoptRef(new BlurFilterOperation(stdDeviation, type));
</del><ins>+ return adoptRef(new BlurFilterOperation(stdDeviation));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Length stdDeviation() const { return m_stdDeviation; }
</span><span class="lines">@@ -271,16 +288,10 @@
</span><span class="cx"> virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- virtual bool operator==(const FilterOperation& o) const
- {
- if (!isSameType(o))
- return false;
- const BlurFilterOperation* other = static_cast<const BlurFilterOperation*>(&o);
- return m_stdDeviation == other->m_stdDeviation;
- }
</del><ins>+ virtual bool operator==(const FilterOperation&) const;
</ins><span class="cx">
</span><del>- BlurFilterOperation(Length stdDeviation, OperationType type)
- : FilterOperation(type)
</del><ins>+ BlurFilterOperation(Length stdDeviation)
+ : FilterOperation(BLUR)
</ins><span class="cx"> , m_stdDeviation(stdDeviation)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -288,11 +299,13 @@
</span><span class="cx"> Length m_stdDeviation;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+FILTEROPERATION_TYPE_CASTS(BlurFilterOperation, type() == FilterOperation::BLUR);
+
</ins><span class="cx"> class DropShadowFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color, OperationType type)
</del><ins>+ static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color)
</ins><span class="cx"> {
</span><del>- return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color, type));
</del><ins>+ return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int x() const { return m_location.x(); }
</span><span class="lines">@@ -307,17 +320,10 @@
</span><span class="cx"> virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress, bool blendToPassthrough = false);
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ virtual bool operator==(const FilterOperation&) const;
</ins><span class="cx">
</span><del>- virtual bool operator==(const FilterOperation& o) const
- {
- if (!isSameType(o))
- return false;
- const DropShadowFilterOperation* other = static_cast<const DropShadowFilterOperation*>(&o);
- return m_location == other->m_location && m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
- }
-
- DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color, OperationType type)
- : FilterOperation(type)
</del><ins>+ DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color)
+ : FilterOperation(DROP_SHADOW)
</ins><span class="cx"> , m_location(location)
</span><span class="cx"> , m_stdDeviation(stdDeviation)
</span><span class="cx"> , m_color(color)
</span><span class="lines">@@ -329,16 +335,8 @@
</span><span class="cx"> Color m_color;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-#define SIMPLE_FILTER_OPERATION_CASTS(ToValueTypeName, predicate) \
- TYPE_CASTS_BASE(ToValueTypeName, FilterOperation, operation, operation->type() == FilterOperation::predicate, operation.type() == FilterOperation::predicate)
</del><ins>+FILTEROPERATION_TYPE_CASTS(DropShadowFilterOperation, type() == FilterOperation::DROP_SHADOW);
</ins><span class="cx">
</span><del>-SIMPLE_FILTER_OPERATION_CASTS(ReferenceFilterOperation, REFERENCE)
-SIMPLE_FILTER_OPERATION_CASTS(BlurFilterOperation, BLUR)
-SIMPLE_FILTER_OPERATION_CASTS(DropShadowFilterOperation, DROP_SHADOW)
-
-TYPE_CASTS_BASE(BasicColorMatrixFilterOperation, FilterOperation, operation, operation->type() == FilterOperation::GRAYSCALE || operation->type() == FilterOperation::SEPIA || operation->type() == FilterOperation::SATURATE || operation->type() == FilterOperation::HUE_ROTATE, operation.type() == FilterOperation::GRAYSCALE || operation.type() == FilterOperation::SEPIA || operation.type() == FilterOperation::SATURATE || operation.type() == FilterOperation::HUE_ROTATE)
-TYPE_CASTS_BASE(BasicComponentTransferFilterOperation, FilterOperation, operation, operation->type() == FilterOperation::INVERT || operation->type() == FilterOperation::BRIGHTNESS || operation->type() == FilterOperation::CONTRAST || operation->type() == FilterOperation::OPACITY, operation.type() == FilterOperation::INVERT || operation.type() == FilterOperation::BRIGHTNESS || operation.type() == FilterOperation::CONTRAST || operation.type() == FilterOperation::OPACITY)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(CSS_FILTERS)
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -122,10 +122,10 @@
</span><span class="cx"> {
</span><span class="cx"> FilterOutsets totalOutsets;
</span><span class="cx"> for (size_t i = 0; i < m_operations.size(); ++i) {
</span><del>- FilterOperation* filterOperation = m_operations.at(i).get();
</del><ins>+ const FilterOperation* filterOperation = m_operations.at(i).get();
</ins><span class="cx"> switch (filterOperation->getOperationType()) {
</span><span class="cx"> case FilterOperation::BLUR: {
</span><del>- BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation*>(filterOperation);
</del><ins>+ const BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx"> float stdDeviation = floatValueForLength(blurOperation->stdDeviation(), 0);
</span><span class="cx"> IntSize outsetSize = outsetSizeForBlur(stdDeviation);
</span><span class="cx"> FilterOutsets outsets(outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width());
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::DROP_SHADOW: {
</span><del>- DropShadowFilterOperation* dropShadowOperation = static_cast<DropShadowFilterOperation*>(filterOperation);
</del><ins>+ const DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx"> IntSize outsetSize = outsetSizeForBlur(dropShadowOperation->stdDeviation());
</span><span class="cx"> FilterOutsets outsets(
</span><span class="cx"> std::max(0, outsetSize.height() - dropShadowOperation->y()),
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorerenderingFilterEffectRenderercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -209,13 +209,13 @@
</span><span class="cx"> FilterOperation* filterOperation = operations.operations().at(i).get();
</span><span class="cx"> switch (filterOperation->getOperationType()) {
</span><span class="cx"> case FilterOperation::REFERENCE: {
</span><del>- ReferenceFilterOperation* referenceOperation = static_cast<ReferenceFilterOperation*>(filterOperation);
</del><ins>+ ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
</ins><span class="cx"> effect = buildReferenceFilter(renderer, previousEffect, referenceOperation);
</span><span class="cx"> referenceOperation->setFilterEffect(effect);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::GRAYSCALE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> Vector<float> inputParameters;
</span><span class="cx"> double oneMinusAmount = clampTo(1 - colorMatrixOperation->amount(), 0.0, 1.0);
</span><span class="cx">
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SEPIA: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> Vector<float> inputParameters;
</span><span class="cx"> double oneMinusAmount = clampTo(1 - colorMatrixOperation->amount(), 0.0, 1.0);
</span><span class="cx">
</span><span class="lines">@@ -271,21 +271,21 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::SATURATE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> Vector<float> inputParameters;
</span><span class="cx"> inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation->amount()));
</span><span class="cx"> effect = FEColorMatrix::create(this, FECOLORMATRIX_TYPE_SATURATE, inputParameters);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::HUE_ROTATE: {
</span><del>- BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast<BasicColorMatrixFilterOperation*>(filterOperation);
</del><ins>+ BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx"> Vector<float> inputParameters;
</span><span class="cx"> inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation->amount()));
</span><span class="cx"> effect = FEColorMatrix::create(this, FECOLORMATRIX_TYPE_HUEROTATE, inputParameters);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::INVERT: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> ComponentTransferFunction transferFunction;
</span><span class="cx"> transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
</span><span class="cx"> Vector<float> transferParameters;
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::OPACITY: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> ComponentTransferFunction transferFunction;
</span><span class="cx"> transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
</span><span class="cx"> Vector<float> transferParameters;
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BRIGHTNESS: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> ComponentTransferFunction transferFunction;
</span><span class="cx"> transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
</span><span class="cx"> transferFunction.slope = narrowPrecisionToFloat(componentTransferOperation->amount());
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::CONTRAST: {
</span><del>- BasicComponentTransferFilterOperation* componentTransferOperation = static_cast<BasicComponentTransferFilterOperation*>(filterOperation);
</del><ins>+ BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx"> ComponentTransferFunction transferFunction;
</span><span class="cx"> transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
</span><span class="cx"> float amount = narrowPrecisionToFloat(componentTransferOperation->amount());
</span><span class="lines">@@ -334,13 +334,13 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::BLUR: {
</span><del>- BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation*>(filterOperation);
</del><ins>+ BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx"> float stdDeviation = floatValueForLength(blurOperation->stdDeviation(), 0);
</span><span class="cx"> effect = FEGaussianBlur::create(this, stdDeviation, stdDeviation);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::DROP_SHADOW: {
</span><del>- DropShadowFilterOperation* dropShadowOperation = static_cast<DropShadowFilterOperation*>(filterOperation);
</del><ins>+ DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx"> effect = FEDropShadow::create(this, dropShadowOperation->stdDeviation(), dropShadowOperation->stdDeviation(),
</span><span class="cx"> dropShadowOperation->x(), dropShadowOperation->y(), dropShadowOperation->color(), 1);
</span><span class="cx"> break;
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorerenderingRenderLayerFilterInfocpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> RefPtr<FilterOperation> filterOperation = operations.operations().at(i);
</span><span class="cx"> if (filterOperation->getOperationType() != FilterOperation::REFERENCE)
</span><span class="cx"> continue;
</span><del>- ReferenceFilterOperation* referenceFilterOperation = static_cast<ReferenceFilterOperation*>(filterOperation.get());
</del><ins>+ ReferenceFilterOperation* referenceFilterOperation = toReferenceFilterOperation(filterOperation.get());
</ins><span class="cx"> CachedSVGDocumentReference* documentReference = referenceFilterOperation->cachedSVGDocumentReference();
</span><span class="cx"> CachedSVGDocument* cachedSVGDocument = documentReference ? documentReference->document() : 0;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx"> Length length;
</span><span class="cx"> if (!ArgumentCoder<Length>::decode(decoder, length))
</span><span class="cx"> return false;
</span><del>- filter = BlurFilterOperation::create(length, type);
</del><ins>+ filter = BlurFilterOperation::create(length);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case FilterOperation::DROP_SHADOW: {
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (!ArgumentCoder<Color>::decode(decoder, color))
</span><span class="cx"> return false;
</span><del>- filter = DropShadowFilterOperation::create(location, stdDeviation, color, type);
</del><ins>+ filter = DropShadowFilterOperation::create(location, stdDeviation, color);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> #if ENABLE(CSS_SHADERS)
</span></span></pre>
</div>
</div>
</body>
</html>