<!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>[191867] trunk/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/191867">191867</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-11-01 16:16:36 -0800 (Sun, 01 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove some dead and unneeded code (ScrollbarThemeSafari, RenderThemeSafari, OPENCL, a little color space logic)
https://bugs.webkit.org/show_bug.cgi?id=150783
Reviewed by Tim Horton.
Source/WebCore:
* PlatformWinCairo.cmake: Removed ScrollbarThemeSafari.cpp, no reason to compile it.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToImage): Removed the code that set a color space
on an image if it's set to device color space. This has been dead code for many releases
of OS X and iOS at this point.
* platform/graphics/filters/FEColorMatrix.h: Removed some ENABLE(OPENCL)-only code.
* platform/graphics/filters/FEFlood.h: Ditto.
* platform/graphics/filters/FEMerge.h: Ditto.
* platform/graphics/filters/FETurbulence.h: Ditto.
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::applyAll): Removed.
(WebCore::FilterEffect::apply): Removed ENABLE(OPENCL)-only code.
(WebCore::FilterEffect::platformApplyOpenCL): Removed.
(WebCore::FilterEffect::clearResult): Removed ENABLE(OPENCL)-only code.
(WebCore::FilterEffect::asImageBuffer): Ditto.
(WebCore::FilterEffect::openCLImageToImageBuffer): Removed.
(WebCore::FilterEffect::createOpenCLImageResult): Removed.
(WebCore::FilterEffect::transformResultColorSpace): Removed ENABLE(OPENCL)-only code.
* platform/graphics/filters/FilterEffect.h: Removed ENABLE(OPENCL)-only code.
* platform/graphics/filters/SourceAlpha.h: Ditto.
* platform/graphics/filters/SourceGraphic.h: Ditto.
* platform/win/ScrollbarThemeSafari.cpp: Removed.
* platform/win/ScrollbarThemeSafari.h: Removed.
* rendering/RenderThemeMac.mm: Removed an obsolete comment.
* rendering/RenderThemeSafari.cpp: Removed.
* rendering/RenderThemeSafari.h: Removed.
* svg/graphics/filters/SVGFEImage.h: Removed ENABLE(OPENCL)-only code.
Source/WTF:
* wtf/FeatureDefines.h: Removed the OPENCL feature, no longer supported.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformWinCairocmake">trunk/Source/WebCore/PlatformWinCairo.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEColorMatrixh">trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEFloodh">trunk/Source/WebCore/platform/graphics/filters/FEFlood.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEMergeh">trunk/Source/WebCore/platform/graphics/filters/FEMerge.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFETurbulenceh">trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersSourceAlphah">trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersSourceGraphich">trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFEImageh">trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformwinScrollbarThemeSafaricpp">trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformwinScrollbarThemeSafarih">trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeSafaricpp">trunk/Source/WebCore/rendering/RenderThemeSafari.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeSafarih">trunk/Source/WebCore/rendering/RenderThemeSafari.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WTF/ChangeLog        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2015-11-01 Darin Adler <darin@apple.com>
+
+ Remove some dead and unneeded code (ScrollbarThemeSafari, RenderThemeSafari, OPENCL, a little color space logic)
+ https://bugs.webkit.org/show_bug.cgi?id=150783
+
+ Reviewed by Tim Horton.
+
+ * wtf/FeatureDefines.h: Removed the OPENCL feature, no longer supported.
+
</ins><span class="cx"> 2015-10-31 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> B3::reduceStrength's DCE should be more agro and less wrong
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -637,10 +637,6 @@
</span><span class="cx"> #define ENABLE_NOTIFICATIONS 0
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if !defined(ENABLE_OPENCL)
-#define ENABLE_OPENCL 0
-#endif
-
</del><span class="cx"> #if !defined(ENABLE_OPENTYPE_VERTICAL)
</span><span class="cx"> #define ENABLE_OPENTYPE_VERTICAL 0
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/ChangeLog        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2015-11-01 Darin Adler <darin@apple.com>
+
+ Remove some dead and unneeded code (ScrollbarThemeSafari, RenderThemeSafari, OPENCL, a little color space logic)
+ https://bugs.webkit.org/show_bug.cgi?id=150783
+
+ Reviewed by Tim Horton.
+
+ * PlatformWinCairo.cmake: Removed ScrollbarThemeSafari.cpp, no reason to compile it.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::setContentsToImage): Removed the code that set a color space
+ on an image if it's set to device color space. This has been dead code for many releases
+ of OS X and iOS at this point.
+
+ * platform/graphics/filters/FEColorMatrix.h: Removed some ENABLE(OPENCL)-only code.
+ * platform/graphics/filters/FEFlood.h: Ditto.
+ * platform/graphics/filters/FEMerge.h: Ditto.
+ * platform/graphics/filters/FETurbulence.h: Ditto.
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::applyAll): Removed.
+ (WebCore::FilterEffect::apply): Removed ENABLE(OPENCL)-only code.
+ (WebCore::FilterEffect::platformApplyOpenCL): Removed.
+ (WebCore::FilterEffect::clearResult): Removed ENABLE(OPENCL)-only code.
+ (WebCore::FilterEffect::asImageBuffer): Ditto.
+ (WebCore::FilterEffect::openCLImageToImageBuffer): Removed.
+ (WebCore::FilterEffect::createOpenCLImageResult): Removed.
+ (WebCore::FilterEffect::transformResultColorSpace): Removed ENABLE(OPENCL)-only code.
+
+ * platform/graphics/filters/FilterEffect.h: Removed ENABLE(OPENCL)-only code.
+ * platform/graphics/filters/SourceAlpha.h: Ditto.
+ * platform/graphics/filters/SourceGraphic.h: Ditto.
+
+ * platform/win/ScrollbarThemeSafari.cpp: Removed.
+ * platform/win/ScrollbarThemeSafari.h: Removed.
+
+ * rendering/RenderThemeMac.mm: Removed an obsolete comment.
+
+ * rendering/RenderThemeSafari.cpp: Removed.
+ * rendering/RenderThemeSafari.h: Removed.
+
+ * svg/graphics/filters/SVGFEImage.h: Removed ENABLE(OPENCL)-only code.
+
</ins><span class="cx"> 2015-11-01 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> Move the ResourceUsageOverlay out of the way by default.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWinCairocmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWinCairo.cmake (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWinCairo.cmake        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/PlatformWinCairo.cmake        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -138,7 +138,6 @@
</span><span class="cx"> platform/win/LoggingWin.cpp
</span><span class="cx"> platform/win/PEImage.cpp
</span><span class="cx"> platform/win/PathWalker.cpp
</span><del>- platform/win/ScrollbarThemeSafari.cpp
</del><span class="cx"> platform/win/WebCoreBundleWin.cpp
</span><span class="cx"> platform/win/WebCoreTextRenderer.cpp
</span><span class="cx"> platform/win/WindowMessageBroadcaster.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -994,17 +994,6 @@
</span><span class="cx"> m_uncorrectedContentsImage = newImage;
</span><span class="cx"> m_pendingContentsImage = newImage;
</span><span class="cx">
</span><del>-#if !PLATFORM(WIN) && !PLATFORM(IOS)
- CGColorSpaceRef colorSpace = CGImageGetColorSpace(m_pendingContentsImage.get());
-
- static CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
- if (colorSpace && CFEqual(colorSpace, deviceRGB)) {
- // CoreGraphics renders images tagged with DeviceRGB using the color space of the main display. When we hand such
- // images to CA we need to tag them similarly so CA rendering matches CG rendering.
- static CGColorSpaceRef genericRGB = CGDisplayCopyColorSpace(kCGDirectMainDisplay);
- m_pendingContentsImage = adoptCF(CGImageCreateCopyWithColorSpace(m_pendingContentsImage.get(), genericRGB));
- }
-#endif
</del><span class="cx"> m_contentsLayerPurpose = ContentsLayerForImage;
</span><span class="cx"> if (!m_contentsLayer)
</span><span class="cx"> noteSublayersChanged();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEColorMatrixh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -48,9 +48,6 @@
</span><span class="cx"> bool setValues(const Vector<float>&);
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware();
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump();
</span><span class="cx">
</span><span class="cx"> virtual TextStream& externalRepresentation(TextStream&, int indention) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEFloodh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -46,9 +46,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware() override;
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL() override;
-#endif
</del><span class="cx"> virtual void dump() override;
</span><span class="cx">
</span><span class="cx"> virtual void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEMergeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEMerge.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEMerge.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMerge.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -33,9 +33,6 @@
</span><span class="cx"> static Ref<FEMerge> create(Filter&);
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware();
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump();
</span><span class="cx">
</span><span class="cx"> virtual TextStream& externalRepresentation(TextStream&, int indention) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFETurbulenceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -60,9 +60,6 @@
</span><span class="cx"> static void fillRegionWorker(void*);
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware();
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump();
</span><span class="cx">
</span><span class="cx"> virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -114,24 +114,6 @@
</span><span class="cx"> return collectEffects(this, allEffects);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
-void FilterEffect::applyAll()
-{
- if (hasResult())
- return;
- FilterContextOpenCL* context = FilterContextOpenCL::context();
- if (context) {
- apply();
- if (!context->inError())
- return;
- clearResultsRecursive();
- context->destroyContext();
- }
- // Software code path.
- apply();
-}
-#endif
-
</del><span class="cx"> void FilterEffect::apply()
</span><span class="cx"> {
</span><span class="cx"> if (hasResult())
</span><span class="lines">@@ -159,38 +141,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Add platform specific apply functions here and return earlier.
</span><del>-#if ENABLE(OPENCL)
- if (platformApplyOpenCL())
- return;
-#endif
</del><span class="cx"> platformApplySoftware();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
-// This function will be changed to abstract virtual when all filters are landed.
-bool FilterEffect::platformApplyOpenCL()
-{
- if (!FilterContextOpenCL::context())
- return false;
-
- unsigned size = m_inputEffects.size();
- for (unsigned i = 0; i < size; ++i) {
- FilterEffect* in = m_inputEffects.at(i).get();
- // Software code path expects that at least one of the following fileds is valid.
- if (!in->m_imageBufferResult && !in->m_unmultipliedImageResult && !in->m_premultipliedImageResult)
- in->asImageBuffer();
- }
-
- platformApplySoftware();
- ImageBuffer* sourceImage = asImageBuffer();
- if (sourceImage) {
- RefPtr<Uint8ClampedArray> sourceImageData = sourceImage->getUnmultipliedImageData(IntRect(IntPoint(), sourceImage->internalSize()));
- createOpenCLImageResult(sourceImageData->data());
- }
- return true;
-}
-#endif
-
</del><span class="cx"> void FilterEffect::forceValidPreMultipliedPixels()
</span><span class="cx"> {
</span><span class="cx"> // Must operate on pre-multiplied results; other formats cannot have invalid pixels.
</span><span class="lines">@@ -248,10 +201,6 @@
</span><span class="cx"> m_unmultipliedImageResult = nullptr;
</span><span class="cx"> if (m_premultipliedImageResult)
</span><span class="cx"> m_premultipliedImageResult = nullptr;
</span><del>-#if ENABLE(OPENCL)
- if (m_openCLImageResult)
- m_openCLImageResult = nullptr;
-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FilterEffect::clearResultsRecursive()
</span><span class="lines">@@ -272,10 +221,6 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (m_imageBufferResult)
</span><span class="cx"> return m_imageBufferResult.get();
</span><del>-#if ENABLE(OPENCL)
- if (m_openCLImageResult)
- return openCLImageToImageBuffer();
-#endif
</del><span class="cx"> m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), m_filter.renderingMode(), m_filter.filterScale(), m_resultColorSpace);
</span><span class="cx"> if (!m_imageBufferResult)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -288,37 +233,6 @@
</span><span class="cx"> return m_imageBufferResult.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
-ImageBuffer* FilterEffect::openCLImageToImageBuffer()
-{
- FilterContextOpenCL* context = FilterContextOpenCL::context();
- ASSERT(context);
-
- if (context->inError())
- return nullptr;
-
- size_t origin[3] = { 0, 0, 0 };
- size_t region[3] = { m_absolutePaintRect.width(), m_absolutePaintRect.height(), 1 };
-
- RefPtr<Uint8ClampedArray> destinationPixelArray = Uint8ClampedArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-
- if (context->isFailed(clFinish(context->commandQueue())))
- return nullptr;
-
- if (context->isFailed(clEnqueueReadImage(context->commandQueue(), m_openCLImageResult, CL_TRUE, origin, region, 0, 0, destinationPixelArray->data(), 0, 0, 0)))
- return nullptr;
-
- m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), m_filter.renderingMode());
- if (!m_imageBufferResult)
- return nullptr;
-
- IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
- m_imageBufferResult->putByteArray(Unmultiplied, destinationPixelArray.get(), destinationRect.size(), destinationRect, IntPoint());
-
- return m_imageBufferResult.get();
-}
-#endif
-
</del><span class="cx"> PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
</span><span class="cx"> {
</span><span class="cx"> IntSize scaledSize(rect.size());
</span><span class="lines">@@ -497,36 +411,6 @@
</span><span class="cx"> return m_premultipliedImageResult.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
-OpenCLHandle FilterEffect::createOpenCLImageResult(uint8_t* source)
-{
- FilterContextOpenCL* context = FilterContextOpenCL::context();
- ASSERT(context);
-
- if (context->inError())
- return 0;
-
- ASSERT(!hasResult());
- cl_image_format clImageFormat;
- clImageFormat.image_channel_order = CL_RGBA;
- clImageFormat.image_channel_data_type = CL_UNORM_INT8;
-
- int errorCode = 0;
-#ifdef CL_API_SUFFIX__VERSION_1_2
- cl_image_desc imageDescriptor = { CL_MEM_OBJECT_IMAGE2D, m_absolutePaintRect.width(), m_absolutePaintRect.height(), 0, 0, 0, 0, 0, 0, 0};
- m_openCLImageResult = clCreateImage(context->deviceContext(), CL_MEM_READ_WRITE | (source ? CL_MEM_COPY_HOST_PTR : 0),
- &clImageFormat, &imageDescriptor, source, &errorCode);
-#else
- m_openCLImageResult = clCreateImage2D(context->deviceContext(), CL_MEM_READ_WRITE | (source ? CL_MEM_COPY_HOST_PTR : 0),
- &clImageFormat, m_absolutePaintRect.width(), m_absolutePaintRect.height(), 0, source, &errorCode);
-#endif
- if (context->isFailed(errorCode))
- return 0;
-
- return m_openCLImageResult;
-}
-#endif
-
</del><span class="cx"> void FilterEffect::transformResultColorSpace(ColorSpace dstColorSpace)
</span><span class="cx"> {
</span><span class="cx"> #if USE(CG)
</span><span class="lines">@@ -536,24 +420,10 @@
</span><span class="cx"> if (!hasResult() || dstColorSpace == m_resultColorSpace)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
- if (openCLImage()) {
- if (m_imageBufferResult)
- m_imageBufferResult = nullptr;
- FilterContextOpenCL* context = FilterContextOpenCL::context();
- ASSERT(context);
- context->openCLTransformColorSpace(m_openCLImageResult, absolutePaintRect(), m_resultColorSpace, dstColorSpace);
- } else {
-#endif
</del><ins>+ // FIXME: We can avoid this potentially unnecessary ImageBuffer conversion by adding
+ // color space transform support for the {pre,un}multiplied arrays.
+ asImageBuffer()->transformColorSpace(m_resultColorSpace, dstColorSpace);
</ins><span class="cx">
</span><del>- // FIXME: We can avoid this potentially unnecessary ImageBuffer conversion by adding
- // color space transform support for the {pre,un}multiplied arrays.
- asImageBuffer()->transformColorSpace(m_resultColorSpace, dstColorSpace);
-
-#if ENABLE(OPENCL)
- }
-#endif
-
</del><span class="cx"> m_resultColorSpace = dstColorSpace;
</span><span class="cx">
</span><span class="cx"> if (m_unmultipliedImageResult)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -25,19 +25,11 @@
</span><span class="cx"> #include "ColorSpace.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "IntRect.h"
</span><del>-
</del><span class="cx"> #include <runtime/Uint8ClampedArray.h>
</span><del>-
-#include <wtf/HashSet.h>
</del><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-#if ENABLE(OPENCL)
-#include "FilterContextOpenCL.h"
-#endif
-
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class Filter;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersSourceAlphah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -32,9 +32,6 @@
</span><span class="cx"> static const AtomicString& effectName();
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware();
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump();
</span><span class="cx">
</span><span class="cx"> virtual void determineAbsolutePaintRect();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersSourceGraphich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -33,9 +33,6 @@
</span><span class="cx"> static const AtomicString& effectName();
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware();
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump();
</span><span class="cx">
</span><span class="cx"> virtual void determineAbsolutePaintRect();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinScrollbarThemeSafaricpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,257 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ScrollbarThemeSafari.h"
-
-#if USE(SAFARI_THEME)
-
-#include "GraphicsContext.h"
-#include "IntRect.h"
-#include "Page.h"
-#include "PlatformMouseEvent.h"
-#include "ScrollableArea.h"
-#include "Scrollbar.h"
-#include "ScrollbarThemeWin.h"
-#include "Settings.h"
-#include "SoftLinking.h"
-
-#include <CoreGraphics/CoreGraphics.h>
-
-// If you have an empty placeholder SafariThemeConstants.h, then include SafariTheme.h
-// This is a workaround until a version of WebKitSupportLibrary is released with an updated SafariThemeConstants.h
-#include <SafariTheme/SafariThemeConstants.h>
-#ifndef SafariThemeConstants_h
-#include <SafariTheme/SafariTheme.h>
-#endif
-
-// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
-
-using namespace std;
-
-namespace WebCore {
-
-using namespace SafariTheme;
-
-ScrollbarTheme& ScrollbarTheme::nativeTheme()
-{
- static ScrollbarThemeSafari safariTheme;
- static ScrollbarThemeWin windowsTheme;
- if (Settings::shouldPaintNativeControls())
- return windowsTheme;
- return safariTheme;
-}
-
-// FIXME: Get these numbers from CoreUI.
-static int cScrollbarThickness[] = { 15, 11 };
-static int cRealButtonLength[] = { 28, 21 };
-static int cButtonInset[] = { 14, 11 };
-static int cButtonHitInset[] = { 3, 2 };
-// cRealButtonLength - cButtonInset
-static int cButtonLength[] = { 14, 10 };
-static int cThumbMinLength[] = { 26, 20 };
-
-#ifdef DEBUG_ALL
-SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
-#else
-SOFT_LINK_LIBRARY(SafariTheme)
-#endif
-
-SOFT_LINK(SafariTheme, paintThemePart, void, __stdcall,
- (ThemePart part, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state),
- (part, context, rect, size, state))
-
-static ScrollbarControlState scrollbarControlStateFromThemeState(ThemeControlState state)
-{
- ScrollbarControlState s = 0;
- if (state & ActiveState)
- s |= ActiveScrollbarState;
- if (state & EnabledState)
- s |= EnabledScrollbarState;
- if (state & PressedState)
- s |= PressedScrollbarState;
- return s;
-}
-
-ScrollbarThemeSafari::~ScrollbarThemeSafari()
-{
-}
-
-int ScrollbarThemeSafari::scrollbarThickness(ScrollbarControlSize controlSize)
-{
- return cScrollbarThickness[controlSize];
-}
-
-bool ScrollbarThemeSafari::hasButtons(Scrollbar& scrollbar)
-{
- return scrollbar.enabled() && (scrollbar.orientation() == HorizontalScrollbar ?
- scrollbar.width() :
- scrollbar.height()) >= 2 * (cRealButtonLength[scrollbar.controlSize()] - cButtonHitInset[scrollbar.controlSize()]);
-}
-
-bool ScrollbarThemeSafari::hasThumb(Scrollbar& scrollbar)
-{
- return scrollbar.enabled() && (scrollbar.orientation() == HorizontalScrollbar ?
- scrollbar.width() :
- scrollbar.height()) >= 2 * cButtonInset[scrollbar.controlSize()] + cThumbMinLength[scrollbar.controlSize()] + 1;
-}
-
-static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, bool start)
-{
- IntRect paintRect(buttonRect);
- if (orientation == HorizontalScrollbar) {
- paintRect.setWidth(cRealButtonLength[controlSize]);
- if (!start)
- paintRect.setX(buttonRect.x() - (cRealButtonLength[controlSize] - buttonRect.width()));
- } else {
- paintRect.setHeight(cRealButtonLength[controlSize]);
- if (!start)
- paintRect.setY(buttonRect.y() - (cRealButtonLength[controlSize] - buttonRect.height()));
- }
-
- return paintRect;
-}
-
-IntRect ScrollbarThemeSafari::backButtonRect(Scrollbar& scrollbar, ScrollbarPart part, bool painting)
-{
- IntRect result;
-
- // Windows just has single arrows.
- if (part == BackButtonEndPart)
- return result;
-
- int thickness = scrollbarThickness(scrollbar.controlSize());
- if (scrollbar.orientation() == HorizontalScrollbar)
- result = IntRect(scrollbar.x(), scrollbar.y(), cButtonLength[scrollbar.controlSize()], thickness);
- else
- result = IntRect(scrollbar.x(), scrollbar.y(), thickness, cButtonLength[scrollbar.controlSize()]);
- if (painting)
- return buttonRepaintRect(result, scrollbar.orientation(), scrollbar.controlSize(), true);
- return result;
-}
-
-IntRect ScrollbarThemeSafari::forwardButtonRect(Scrollbar& scrollbar, ScrollbarPart part, bool painting)
-{
- IntRect result;
-
- // Windows just has single arrows.
- if (part == ForwardButtonStartPart)
- return result;
-
- int thickness = scrollbarThickness(scrollbar.controlSize());
- if (scrollbar.orientation() == HorizontalScrollbar)
- result = IntRect(scrollbar.x() + scrollbar.width() - cButtonLength[scrollbar.controlSize()], scrollbar.y(), cButtonLength[scrollbar.controlSize()], thickness);
- else
- result = IntRect(scrollbar.x(), scrollbar.y() + scrollbar.height() - cButtonLength[scrollbar.controlSize()], thickness, cButtonLength[scrollbar.controlSize()]);
- if (painting)
- return buttonRepaintRect(result, scrollbar.orientation(), scrollbar.controlSize(), false);
- return result;
-}
-
-static IntRect trackRepaintRect(const IntRect& trackRect, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
-{
- IntRect paintRect(trackRect);
- if (orientation == HorizontalScrollbar)
- paintRect.inflateX(cButtonLength[controlSize]);
- else
- paintRect.inflateY(cButtonLength[controlSize]);
-
- return paintRect;
-}
-
-IntRect ScrollbarThemeSafari::trackRect(Scrollbar& scrollbar, bool painting)
-{
- if (painting || !hasButtons(scrollbar))
- return scrollbar.frameRect();
-
- IntRect result;
- int thickness = scrollbarThickness(scrollbar.controlSize());
- if (scrollbar.orientation() == HorizontalScrollbar)
- return IntRect(scrollbar.x() + cButtonLength[scrollbar.controlSize()], scrollbar.y(), scrollbar.width() - 2 * cButtonLength[scrollbar.controlSize()], thickness);
- return IntRect(scrollbar.x(), scrollbar.y() + cButtonLength[scrollbar.controlSize()], thickness, scrollbar.height() - 2 * cButtonLength[scrollbar.controlSize()]);
-}
-
-int ScrollbarThemeSafari::minimumThumbLength(Scrollbar& scrollbar)
-{
- return cThumbMinLength[scrollbar.controlSize()];
-}
-
-bool ScrollbarThemeSafari::shouldCenterOnThumb(Scrollbar&, const PlatformMouseEvent& evt)
-{
- return evt.shiftKey() && evt.button() == LeftButton;
-}
-
-void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext& graphicsContext, Scrollbar& scrollbar, const IntRect& trackRect)
-{
- if (!SafariThemeLibrary())
- return;
- NSControlSize size = scrollbar.controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
- ThemeControlState state = 0;
- if (scrollbar.isScrollableAreaActive())
- state |= ActiveState;
- if (hasButtons(scrollbar))
- state |= EnabledState;
- paintThemePart(scrollbar.orientation() == VerticalScrollbar ? VScrollTrackPart : HScrollTrackPart, graphicsContext.platformContext(), trackRect, size, state);
-}
-
-void ScrollbarThemeSafari::paintButton(GraphicsContext& graphicsContext, Scrollbar& scrollbar, const IntRect& buttonRect, ScrollbarPart part)
-{
- if (!SafariThemeLibrary())
- return;
- NSControlSize size = scrollbar.controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
- ThemeControlState state = 0;
- if (scrollbar.isScrollableAreaActive())
- state |= ActiveState;
- if (hasButtons(scrollbar))
- state |= EnabledState;
- if (scrollbar.pressedPart() == part)
- state |= PressedState;
- if (part == BackButtonStartPart)
- paintThemePart(scrollbar.orientation() == VerticalScrollbar ? ScrollUpArrowPart : ScrollLeftArrowPart, graphicsContext.platformContext(),
- buttonRect, size, state);
- else if (part == ForwardButtonEndPart)
- paintThemePart(scrollbar.orientation() == VerticalScrollbar ? ScrollDownArrowPart : ScrollRightArrowPart, graphicsContext.platformContext(),
- buttonRect, size, state);
-}
-
-void ScrollbarThemeSafari::paintThumb(GraphicsContext& graphicsContext, Scrollbar& scrollbar, const IntRect& thumbRect)
-{
- if (!SafariThemeLibrary())
- return;
- NSControlSize size = scrollbar.controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
- ThemeControlState state = 0;
- if (scrollbar.isScrollableAreaActive())
- state |= ActiveState;
- if (hasThumb(scrollbar))
- state |= EnabledState;
- if (scrollbar.pressedPart() == ThumbPart)
- state |= PressedState;
- paintThemePart(scrollbar.orientation() == VerticalScrollbar ? VScrollThumbPart : HScrollThumbPart, graphicsContext.platformContext(),
- thumbRect, size, state);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformwinScrollbarThemeSafarih"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ScrollbarThemeSafari_h
-#define ScrollbarThemeSafari_h
-
-#if USE(SAFARI_THEME)
-
-#include "ScrollbarThemeComposite.h"
-
-namespace WebCore {
-
-class ScrollbarThemeSafari : public ScrollbarThemeComposite {
-public:
- virtual ~ScrollbarThemeSafari();
-
- virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
-
- virtual bool supportsControlTints() const { return true; }
-
-protected:
- virtual bool hasButtons(Scrollbar&);
- virtual bool hasThumb(Scrollbar&);
-
- virtual IntRect backButtonRect(Scrollbar&, ScrollbarPart, bool painting = false);
- virtual IntRect forwardButtonRect(Scrollbar&, ScrollbarPart, bool painting = false);
- virtual IntRect trackRect(Scrollbar&, bool painting = false);
-
- virtual int minimumThumbLength(Scrollbar&);
-
- virtual bool shouldCenterOnThumb(Scrollbar&, const PlatformMouseEvent&);
-
- virtual void paintTrackBackground(GraphicsContext&, Scrollbar&, const IntRect&);
- virtual void paintButton(GraphicsContext&, Scrollbar&, const IntRect&, ScrollbarPart);
- virtual void paintThumb(GraphicsContext&, Scrollbar&, const IntRect&);
-};
-
-}
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -114,8 +114,6 @@
</span><span class="cx">
</span><span class="cx"> // The methods in this file are specific to the Mac OS X platform.
</span><span class="cx">
</span><del>-// FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeSafari.
-
</del><span class="cx"> // We estimate the animation rate of a Mac OS X progress bar is 33 fps.
</span><span class="cx"> // Hard code the value here because we haven't found API for it.
</span><span class="cx"> const double progressAnimationFrameRate = 0.033;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeSafaricpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,1211 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2013 Apple Inc.
- * Copyright (C) 2009 Kenneth Rohde Christiansen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "RenderThemeSafari.h"
-#include "RenderThemeWin.h"
-#include "Settings.h"
-
-#if USE(SAFARI_THEME)
-
-#include "CSSFontSelector.h"
-#include "CSSValueKeywords.h"
-#include "Document.h"
-#include "Element.h"
-#include "FloatRoundedRect.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "GraphicsContextCG.h"
-#include "HTMLInputElement.h"
-#include "HTMLMediaElement.h"
-#include "HTMLMeterElement.h"
-#include "HTMLNames.h"
-#include "PaintInfo.h"
-#include "RenderMediaControls.h"
-#include "RenderMeter.h"
-#include "RenderSlider.h"
-#include "RenderView.h"
-#include "SoftLinking.h"
-#include "StyleResolver.h"
-#include "UserAgentStyleSheets.h"
-#include "WebCoreBundleWin.h"
-#include <CoreGraphics/CoreGraphics.h>
-#include <wtf/RetainPtr.h>
-
-using std::min;
-
-// FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeMac.
-
-namespace WebCore {
-
-using namespace HTMLNames;
-using namespace SafariTheme;
-
-enum {
- topMargin,
- rightMargin,
- bottomMargin,
- leftMargin
-};
-
-enum {
- topPadding,
- rightPadding,
- bottomPadding,
- leftPadding
-};
-
-Ref<RenderTheme> RenderThemeSafari::create()
-{
- return adoptRef(*new RenderThemeSafari);
-}
-
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
-{
- static RenderTheme& safariTheme = RenderThemeSafari::create().leakRef();
- static RenderTheme& windowsTheme = RenderThemeWin::create().leakRef();
-
- // FIXME: This is called before Settings has been initialized by WebKit, so will return a
- // potentially wrong answer the very first time it's called (see
- // <https://bugs.webkit.org/show_bug.cgi?id=26493>).
- if (Settings::shouldPaintNativeControls()) {
- RenderTheme::setCustomFocusRingColor(safariTheme->platformFocusRingColor());
- return &windowsTheme;
- }
- return &safariTheme;
-}
-
-#ifdef DEBUG_ALL
-SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
-#else
-SOFT_LINK_LIBRARY(SafariTheme)
-#endif
-
-SOFT_LINK(SafariTheme, paintThemePart, void, __stdcall, (ThemePart part, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state), (part, context, rect, size, state))
-#if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 2
-SOFT_LINK(SafariTheme, STPaintProgressIndicator, void, APIENTRY, (ProgressIndicatorType type, CGContextRef context, const CGRect& rect, NSControlSize size, ThemeControlState state, float value), (type, context, rect, size, state, value))
-#endif
-SOFT_LINK_OPTIONAL(SafariTheme, STCopyThemeColor, CGColorRef, APIENTRY, (unsigned color, SafariTheme::ThemeControlState));
-
-static const unsigned stFocusRingColorID = 4;
-
-static const unsigned aquaFocusRingColor = 0xFF7DADD9;
-
-static RGBA32 makeRGBAFromCGColor(CGColorRef color)
-{
- const CGFloat* components = CGColorGetComponents(color);
- return makeRGBA(255 * components[0], 255 * components[1], 255 * components[2], 255 * components[3]);
-}
-
-ThemeControlState RenderThemeSafari::determineState(const RenderObject& o) const
-{
- ThemeControlState result = 0;
- if (isActive(o))
- result |= SafariTheme::ActiveState;
- if (isEnabled(o) && !isReadOnlyControl(o))
- result |= SafariTheme::EnabledState;
- if (isPressed(o))
- result |= SafariTheme::PressedState;
- if (isChecked(o))
- result |= SafariTheme::CheckedState;
- if (isIndeterminate(o))
- result |= SafariTheme::IndeterminateCheckedState;
- if (isFocused(o))
- result |= SafariTheme::FocusedState;
- if (isDefault(o))
- result |= SafariTheme::DefaultState;
- return result;
-}
-
-static NSControlSize controlSizeFromRect(const IntRect& rect, const IntSize sizes[])
-{
- if (sizes[NSRegularControlSize].height() == rect.height())
- return NSRegularControlSize;
- else if (sizes[NSMiniControlSize].height() == rect.height())
- return NSMiniControlSize;
-
- return NSSmallControlSize;
-}
-
-RenderThemeSafari::RenderThemeSafari()
-{
-}
-
-RenderThemeSafari::~RenderThemeSafari()
-{
-}
-
-Color RenderThemeSafari::platformActiveSelectionBackgroundColor() const
-{
- return Color(181, 213, 255);
-}
-
-Color RenderThemeSafari::platformInactiveSelectionBackgroundColor() const
-{
- return Color(212, 212, 212);
-}
-
-Color RenderThemeSafari::activeListBoxSelectionBackgroundColor() const
-{
- // FIXME: This should probably just be a darker version of the platformActiveSelectionBackgroundColor
- return Color(56, 117, 215);
-}
-
-Color RenderThemeSafari::platformFocusRingColor() const
-{
- static Color focusRingColor;
-
- if (!focusRingColor.isValid()) {
- if (STCopyThemeColorPtr()) {
- RetainPtr<CGColorRef> color = adoptCF(STCopyThemeColorPtr()(stFocusRingColorID, SafariTheme::ActiveState));
- focusRingColor = makeRGBAFromCGColor(color.get());
- }
- if (!focusRingColor.isValid())
- focusRingColor = aquaFocusRingColor;
- }
-
- return focusRingColor;
-}
-
-static float systemFontSizeForControlSize(NSControlSize controlSize)
-{
- static float sizes[] = { 13.0f, 11.0f, 9.0f };
-
- return sizes[controlSize];
-}
-
-void RenderThemeSafari::updateCachedSystemFontDescription(CSSValueID valueID, FontCascadeDescription& fontDescription) const
-{
- float fontSize;
- switch (valueID) {
- case CSSValueSmallCaption:
- fontSize = systemFontSizeForControlSize(NSSmallControlSize);
- break;
- case CSSValueMenu:
- fontSize = systemFontSizeForControlSize(NSRegularControlSize);
- break;
- case CSSValueStatusBar:
- fontSize = 10.0f;
- break;
- case CSSValueWebkitMiniControl:
- fontSize = systemFontSizeForControlSize(NSMiniControlSize);
- break;
- case CSSValueWebkitSmallControl:
- fontSize = systemFontSizeForControlSize(NSSmallControlSize);
- break;
- case CSSValueWebkitControl:
- fontSize = systemFontSizeForControlSize(NSRegularControlSize);
- break;
- default:
- fontSize = 13.0f;
- }
-
- if (!fontSize)
- return;
-
- fontDescription.setIsAbsoluteSize(true);
- fontDescription.setOneFamily("Lucida Grande");
- fontDescription.setSpecifiedSize(fontSize);
- fontDescription.setWeight(FontWeightNormal);
- fontDescription.setItalic(FontItalicOff);
-}
-
-bool RenderThemeSafari::isControlStyled(const RenderStyle& style, const BorderData& border,
- const FillLayer& background, const Color& backgroundColor) const
-{
- // If we didn't find SafariTheme.dll we won't be able to paint any themed controls.
- if (!SafariThemeLibrary())
- return true;
-
- if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPart || style.appearance() == ListboxPart)
- return style.border() != border;
- return RenderTheme::isControlStyled(style, border, background, backgroundColor);
-}
-
-void RenderThemeSafari::adjustRepaintRect(const RenderObject& o, IntRect& r)
-{
- NSControlSize controlSize = controlSizeForFont(o.style());
-
- switch (o.style().appearance()) {
- case CheckboxPart: {
- // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
- // shadow" and the check. We don't consider this part of the bounds of the control in WebKit.
- r = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize));
- break;
- }
- case RadioPart: {
- // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
- // shadow" and the check. We don't consider this part of the bounds of the control in WebKit.
- r = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));
- break;
- }
- case PushButtonPart:
- case DefaultButtonPart:
- case ButtonPart: {
- // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
- // shadow" and the check. We don't consider this part of the bounds of the control in WebKit.
- if (r.height() <= buttonSizes()[NSRegularControlSize].height())
- r = inflateRect(r, buttonSizes()[controlSize], buttonMargins(controlSize));
- break;
- }
- case MenulistPart: {
- r = inflateRect(r, popupButtonSizes()[controlSize], popupButtonMargins(controlSize));
- break;
- }
- default:
- break;
- }
-}
-
-IntRect RenderThemeSafari::inflateRect(const IntRect& r, const IntSize& size, const int* margins) const
-{
- // Only do the inflation if the available width/height are too small. Otherwise try to
- // fit the glow/check space into the available box's width/height.
- int widthDelta = r.width() - (size.width() + margins[leftMargin] + margins[rightMargin]);
- int heightDelta = r.height() - (size.height() + margins[topMargin] + margins[bottomMargin]);
- IntRect result(r);
- if (widthDelta < 0) {
- result.setX(result.x() - margins[leftMargin]);
- result.setWidth(result.width() - widthDelta);
- }
- if (heightDelta < 0) {
- result.setY(result.y() - margins[topMargin]);
- result.setHeight(result.height() - heightDelta);
- }
- return result;
-}
-
-int RenderThemeSafari::baselinePosition(const RenderBox& box) const
-{
- if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart)
- return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
- return RenderTheme::baselinePosition(box);
-}
-
-bool RenderThemeSafari::controlSupportsTints(const RenderObject& o) const
-{
- if (!isEnabled(o))
- return false;
-
- // Checkboxes only have tint when checked.
- if (o.style().appearance() == CheckboxPart)
- return isChecked(o);
-
- // For now assume other controls have tint if enabled.
- return true;
-}
-
-NSControlSize RenderThemeSafari::controlSizeForFont(RenderStyle& style) const
-{
- int fontSize = style.fontSize();
- if (fontSize >= 16)
- return NSRegularControlSize;
- if (fontSize >= 11)
- return NSSmallControlSize;
- return NSMiniControlSize;
-}
-/*
-void RenderThemeSafari::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize)
-{
- NSControlSize size;
- if (minSize.width() >= sizes[NSRegularControlSize].width() &&
- minSize.height() >= sizes[NSRegularControlSize].height())
- size = NSRegularControlSize;
- else if (minSize.width() >= sizes[NSSmallControlSize].width() &&
- minSize.height() >= sizes[NSSmallControlSize].height())
- size = NSSmallControlSize;
- else
- size = NSMiniControlSize;
- if (size != [cell controlSize]) // Only update if we have to, since AppKit does work even if the size is the same.
- [cell setControlSize:size];
-}
-*/
-IntSize RenderThemeSafari::sizeForFont(RenderStyle& style, const IntSize* sizes) const
-{
- return sizes[controlSizeForFont(style)];
-}
-
-IntSize RenderThemeSafari::sizeForSystemFont(RenderStyle& style, const IntSize* sizes) const
-{
- return sizes[controlSizeForSystemFont(style)];
-}
-
-void RenderThemeSafari::setSizeFromFont(RenderStyle& style, const IntSize* sizes) const
-{
- // FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
- IntSize size = sizeForFont(style, sizes);
- if (style.width().isIntrinsicOrAuto() && size.width() > 0)
- style.setWidth(Length(size.width(), Fixed));
- if (style.height().isAuto() && size.height() > 0)
- style.setHeight(Length(size.height(), Fixed));
-}
-
-void RenderThemeSafari::setFontFromControlSize(StyleResolver& styleResolver, RenderStyle& style, NSControlSize controlSize) const
-{
- FontCascadeDescription fontDescription;
- fontDescription.setIsAbsoluteSize(true);
-
- float fontSize = systemFontSizeForControlSize(controlSize);
- fontDescription.setOneFamily("Lucida Grande");
- fontDescription.setComputedSize(fontSize);
- fontDescription.setSpecifiedSize(fontSize);
-
- // Reset line height
- style.setLineHeight(RenderStyle::initialLineHeight());
-
- if (style.setFontDescription(fontDescription))
- style.fontCascade().update(&styleResolver.document().fontSelector());
-}
-
-NSControlSize RenderThemeSafari::controlSizeForSystemFont(RenderStyle& style) const
-{
- int fontSize = style.fontSize();
- if (fontSize >= 13)
- return NSRegularControlSize;
- if (fontSize >= 11)
- return NSSmallControlSize;
- return NSMiniControlSize;
-}
-
-bool RenderThemeSafari::paintCheckbox(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- NSControlSize controlSize = controlSizeForFont(o.style());
-
- IntRect inflatedRect = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize));
- paintThemePart(SafariTheme::CheckboxPart, paintInfo.context().platformContext(), inflatedRect, controlSize, determineState(o));
-
- return false;
-}
-
-const IntSize* RenderThemeSafari::checkboxSizes() const
-{
- static const IntSize sizes[3] = { IntSize(14, 14), IntSize(12, 12), IntSize(10, 10) };
- return sizes;
-}
-
-const int* RenderThemeSafari::checkboxMargins(NSControlSize controlSize) const
-{
- static const int margins[3][4] =
- {
- { 2, 2, 2, 2 },
- { 2, 2, 2, 1 },
- { 1, 0, 0, 0 },
- };
- return margins[controlSize];
-}
-
-void RenderThemeSafari::setCheckboxSize(RenderStyle& style) const
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
- return;
-
- // Use the font size to determine the intrinsic width of the control.
- setSizeFromFont(style, checkboxSizes());
-}
-
-bool RenderThemeSafari::paintRadio(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- NSControlSize controlSize = controlSizeForFont(o.style());
-
- IntRect inflatedRect = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));
- paintThemePart(RadioButtonPart, paintInfo.context().platformContext(), inflatedRect, controlSize, determineState(o));
-
- return false;
-}
-
-const IntSize* RenderThemeSafari::radioSizes() const
-{
- static const IntSize sizes[3] = { IntSize(14, 15), IntSize(12, 13), IntSize(10, 10) };
- return sizes;
-}
-
-const int* RenderThemeSafari::radioMargins(NSControlSize controlSize) const
-{
- static const int margins[3][4] =
- {
- { 1, 2, 2, 2 },
- { 0, 1, 2, 1 },
- { 0, 0, 1, 0 },
- };
- return margins[controlSize];
-}
-
-void RenderThemeSafari::setRadioSize(RenderStyle& style) const
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
- return;
-
- // Use the font size to determine the intrinsic width of the control.
- setSizeFromFont(style, radioSizes());
-}
-
-void RenderThemeSafari::setButtonPaddingFromControlSize(RenderStyle& style, NSControlSize size) const
-{
- // Just use 8px. AppKit wants to use 11px for mini buttons, but that padding is just too large
- // for real-world Web sites (creating a huge necessary minimum width for buttons whose space is
- // by definition constrained, since we select mini only for small cramped environments.
- // This also guarantees the HTML4 <button> will match our rendering by default, since we're using a consistent
- // padding.
- const int padding = 8;
- style.setPaddingLeft(Length(padding, Fixed));
- style.setPaddingRight(Length(padding, Fixed));
- style.setPaddingTop(Length(0, Fixed));
- style.setPaddingBottom(Length(0, Fixed));
-}
-
-void RenderThemeSafari::adjustButtonStyle(StyleResolver& styleResolver, RenderStyle& style, Element*) const
-{
- // There are three appearance constants for buttons.
- // (1) Push-button is the constant for the default Aqua system button. Push buttons will not scale vertically and will not allow
- // custom fonts or colors. <input>s use this constant. This button will allow custom colors and font weights/variants but won't
- // scale vertically.
- // (2) square-button is the constant for the square button. This button will allow custom fonts and colors and will scale vertically.
- // (3) Button is the constant that means "pick the best button as appropriate." <button>s use this constant. This button will
- // also scale vertically and allow custom fonts and colors. It will attempt to use Aqua if possible and will make this determination
- // solely on the rectangle of the control.
-
- // Determine our control size based off our font.
- NSControlSize controlSize = controlSizeForFont(style);
-
- if (style.appearance() == PushButtonPart) {
- // Ditch the border.
- style.resetBorder();
-
- // Height is locked to auto.
- style.setHeight(Length(Auto));
-
- // White-space is locked to pre
- style.setWhiteSpace(PRE);
-
- // Set the button's vertical size.
- setButtonSize(style);
-
- // Add in the padding that we'd like to use.
- setButtonPaddingFromControlSize(style, controlSize);
-
- // Our font is locked to the appropriate system font size for the control. To clarify, we first use the CSS-specified font to figure out
- // a reasonable control size, but once that control size is determined, we throw that font away and use the appropriate
- // system font for the control size instead.
- setFontFromControlSize(styleResolver, style, controlSize);
- } else {
- // Set a min-height so that we can't get smaller than the mini button.
- style.setMinHeight(Length(15, Fixed));
-
- // Reset the top and bottom borders.
- style.resetBorderTop();
- style.resetBorderBottom();
- }
-}
-
-const IntSize* RenderThemeSafari::buttonSizes() const
-{
- static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) };
- return sizes;
-}
-
-const int* RenderThemeSafari::buttonMargins(NSControlSize controlSize) const
-{
- static const int margins[3][4] =
- {
- { 4, 6, 7, 6 },
- { 4, 5, 6, 5 },
- { 0, 1, 1, 1 },
- };
- return margins[controlSize];
-}
-
-void RenderThemeSafari::setButtonSize(RenderStyle& style) const
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
- return;
-
- // Use the font size to determine the intrinsic width of the control.
- setSizeFromFont(style, buttonSizes());
-}
-
-bool RenderThemeSafari::paintButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- // We inflate the rect as needed to account for padding included in the cell to accommodate the button
- // shadow. We don't consider this part of the bounds of the control in WebKit.
-
- NSControlSize controlSize = controlSizeFromRect(r, buttonSizes());
- IntRect inflatedRect = r;
-
- ThemePart part;
- if (r.height() <= buttonSizes()[NSRegularControlSize].height()) {
- // Push button
- part = SafariTheme::PushButtonPart;
-
- IntSize size = buttonSizes()[controlSize];
- size.setWidth(r.width());
-
- // Center the button within the available space.
- if (inflatedRect.height() > size.height()) {
- inflatedRect.setY(inflatedRect.y() + (inflatedRect.height() - size.height()) / 2);
- inflatedRect.setHeight(size.height());
- }
-
- // Now inflate it to account for the shadow.
- inflatedRect = inflateRect(inflatedRect, size, buttonMargins(controlSize));
- } else
- part = SafariTheme::SquareButtonPart;
-
- paintThemePart(part, paintInfo.context().platformContext(), inflatedRect, controlSize, determineState(o));
- return false;
-}
-
-bool RenderThemeSafari::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- paintThemePart(SafariTheme::TextFieldPart, paintInfo.context().platformContext(), r, (NSControlSize)0, determineState(o) & ~FocusedState);
- return false;
-}
-
-void RenderThemeSafari::adjustTextFieldStyle(StyleResolver&, RenderStyle&, Element*) const
-{
-}
-
-bool RenderThemeSafari::paintCapsLockIndicator(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
-#if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 1
- ASSERT(SafariThemeLibrary());
-
- if (paintInfo.context().paintingDisabled())
- return true;
-
- paintThemePart(CapsLockPart, paintInfo.context().platformContext(), r, (NSControlSize)0, (ThemeControlState)0);
-
- return false;
-#else
- return true;
-#endif
-}
-
-bool RenderThemeSafari::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- paintThemePart(SafariTheme::TextAreaPart, paintInfo.context().platformContext(), r, (NSControlSize)0, determineState(o) & ~FocusedState);
- return false;
-}
-
-void RenderThemeSafari::adjustTextAreaStyle(StyleResolver&, RenderStyle&, Element*) const
-{
-}
-
-const int* RenderThemeSafari::popupButtonMargins(NSControlSize size) const
-{
- static const int margins[3][4] =
- {
- { 2, 3, 3, 3 },
- { 1, 3, 3, 3 },
- { 0, 1, 0, 1 }
- };
- return margins[size];
-}
-
-const IntSize* RenderThemeSafari::popupButtonSizes() const
-{
- static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) };
- return sizes;
-}
-
-const int* RenderThemeSafari::popupButtonPadding(NSControlSize size) const
-{
- static const int padding[3][4] =
- {
- { 2, 26, 3, 8 },
- { 2, 23, 3, 8 },
- { 2, 22, 3, 10 }
- };
- return padding[size];
-}
-
-bool RenderThemeSafari::paintMenuList(const RenderObject& o, const PaintInfo& info, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- NSControlSize controlSize = controlSizeFromRect(r, popupButtonSizes());
- IntRect inflatedRect = r;
- IntSize size = popupButtonSizes()[controlSize];
- size.setWidth(r.width());
-
- // Now inflate it to account for the shadow.
- if (r.width() >= minimumMenuListSize(o.style()))
- inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(controlSize));
-
- paintThemePart(DropDownButtonPart, info.context().platformContext(), inflatedRect, controlSize, determineState(o));
-
- return false;
-}
-
-const float baseFontSize = 11.0f;
-const float baseArrowHeight = 5.0f;
-const float baseArrowWidth = 7.0f;
-const int arrowPaddingLeft = 5;
-const int arrowPaddingRight = 5;
-const int paddingBeforeSeparator = 4;
-const int baseBorderRadius = 5;
-const int styledPopupPaddingLeft = 8;
-const int styledPopupPaddingTop = 1;
-const int styledPopupPaddingBottom = 2;
-
-static void TopGradientInterpolate(void* info, const CGFloat* inData, CGFloat* outData)
-{
- static float dark[4] = { 1.0f, 1.0f, 1.0f, 0.4f };
- static float light[4] = { 1.0f, 1.0f, 1.0f, 0.15f };
- float a = inData[0];
- int i = 0;
- for (i = 0; i < 4; i++)
- outData[i] = (1.0f - a) * dark[i] + a * light[i];
-}
-
-static void BottomGradientInterpolate(void* info, const CGFloat* inData, CGFloat* outData)
-{
- static float dark[4] = { 1.0f, 1.0f, 1.0f, 0.0f };
- static float light[4] = { 1.0f, 1.0f, 1.0f, 0.3f };
- float a = inData[0];
- int i = 0;
- for (i = 0; i < 4; i++)
- outData[i] = (1.0f - a) * dark[i] + a * light[i];
-}
-
-static void MainGradientInterpolate(void* info, const CGFloat* inData, CGFloat* outData)
-{
- static float dark[4] = { 0.0f, 0.0f, 0.0f, 0.15f };
- static float light[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
- float a = inData[0];
- int i = 0;
- for (i = 0; i < 4; i++)
- outData[i] = (1.0f - a) * dark[i] + a * light[i];
-}
-
-static void TrackGradientInterpolate(void* info, const CGFloat* inData, CGFloat* outData)
-{
- static float dark[4] = { 0.0f, 0.0f, 0.0f, 0.678f };
- static float light[4] = { 0.0f, 0.0f, 0.0f, 0.13f };
- float a = inData[0];
- int i = 0;
- for (i = 0; i < 4; i++)
- outData[i] = (1.0f - a) * dark[i] + a * light[i];
-}
-
-void RenderThemeSafari::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- if (r.isEmpty())
- return;
-
- CGContextRef context = paintInfo.context().platformContext();
-
- paintInfo.context().save();
-
- FloatRoundedRect bound = FloatRoundedRect(o.style().getRoundedBorderFor(r));
- int radius = bound.radii().topLeft().width();
-
- CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
-
- FloatRect topGradient(r.x(), r.y(), r.width(), r.height() / 2.0f);
- struct CGFunctionCallbacks topCallbacks = { 0, TopGradientInterpolate, NULL };
- RetainPtr<CGFunctionRef> topFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &topCallbacks));
- RetainPtr<CGShadingRef> topShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(topGradient.x(), topGradient.y()), CGPointMake(topGradient.x(), topGradient.maxY()), topFunction.get(), false, false));
-
- FloatRect bottomGradient(r.x() + radius, r.y() + r.height() / 2.0f, r.width() - 2.0f * radius, r.height() / 2.0f);
- struct CGFunctionCallbacks bottomCallbacks = { 0, BottomGradientInterpolate, NULL };
- RetainPtr<CGFunctionRef> bottomFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &bottomCallbacks));
- RetainPtr<CGShadingRef> bottomShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bottomGradient.x(), bottomGradient.y()), CGPointMake(bottomGradient.x(), bottomGradient.maxY()), bottomFunction.get(), false, false));
-
- struct CGFunctionCallbacks mainCallbacks = { 0, MainGradientInterpolate, NULL };
- RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
- RetainPtr<CGShadingRef> mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(r.x(), r.y()), CGPointMake(r.x(), r.maxY()), mainFunction.get(), false, false));
-
- RetainPtr<CGShadingRef> leftShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(r.x(), r.y()), CGPointMake(r.x() + radius, r.y()), mainFunction.get(), false, false));
-
- RetainPtr<CGShadingRef> rightShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(r.maxX(), r.y()), CGPointMake(r.maxX() - radius, r.y()), mainFunction.get(), false, false));
- paintInfo.context().save();
- CGContextClipToRect(context, r);
- paintInfo.context().clipRoundedRect(bound);
- CGContextDrawShading(context, mainShading.get());
- paintInfo.context().restore();
-
- paintInfo.context().save();
- CGContextClipToRect(context, topGradient);
- paintInfo.context().clipRoundedRect(FloatRoundedRect(enclosingIntRect(topGradient), bound.radii().topLeft(), bound.radii().topRight(), IntSize(), IntSize()));
- CGContextDrawShading(context, topShading.get());
- paintInfo.context().restore();
-
- if (!bottomGradient.isEmpty()) {
- paintInfo.context().save();
- CGContextClipToRect(context, bottomGradient);
- paintInfo.context().clipRoundedRect(FloatRoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), bound.radii().bottomLeft(), bound.radii().bottomRight()));
- CGContextDrawShading(context, bottomShading.get());
- paintInfo.context().restore();
- }
-
- paintInfo.context().save();
- CGContextClipToRect(context, r);
- paintInfo.context().clipRoundedRect(bound);
- CGContextDrawShading(context, leftShading.get());
- CGContextDrawShading(context, rightShading.get());
- paintInfo.context().restore();
-
- paintInfo.context().restore();
-}
-
-bool RenderThemeSafari::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect)
-{
- IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(),
- rect.y() + renderer.style().borderTopWidth(),
- rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(),
- rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth());
- // Draw the gradients to give the styled popup menu a button appearance
- paintMenuListButtonGradients(renderer, paintInfo, bounds);
-
- // Since we actually know the size of the control here, we restrict the font scale to make sure the arrow will fit vertically in the bounds
- float fontScale = min(renderer.style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
- float centerY = bounds.y() + bounds.height() / 2.0f;
- float arrowHeight = baseArrowHeight * fontScale;
- float arrowWidth = baseArrowWidth * fontScale;
- float leftEdge = bounds.maxX() - arrowPaddingRight - arrowWidth;
-
- if (bounds.width() < arrowWidth + arrowPaddingLeft)
- return false;
-
- paintInfo.context().save();
-
- paintInfo.context().setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
- paintInfo.context().setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
-
- FloatPoint arrow[3];
- arrow[0] = FloatPoint(leftEdge, centerY - arrowHeight / 2.0f);
- arrow[1] = FloatPoint(leftEdge + arrowWidth, centerY - arrowHeight / 2.0f);
- arrow[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY + arrowHeight / 2.0f);
-
- // Draw the arrow
- paintInfo.context().drawConvexPolygon(3, arrow, true);
-
- Color leftSeparatorColor(0, 0, 0, 40);
- Color rightSeparatorColor(255, 255, 255, 40);
-
- // FIXME: Should the separator thickness and space be scaled up by fontScale?
- int separatorSpace = 2;
- int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft); // FIXME: Round?
-
- // Draw the separator to the left of the arrows
- paintInfo.context().setStrokeThickness(1);
- paintInfo.context().setStrokeStyle(SolidStroke);
- paintInfo.context().setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
- paintInfo.context().drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
- IntPoint(leftEdgeOfSeparator, bounds.maxY()));
-
- paintInfo.context().setStrokeColor(rightSeparatorColor, ColorSpaceDeviceRGB);
- paintInfo.context().drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
- IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.maxY()));
-
- paintInfo.context().restore();
- return false;
-}
-
-void RenderThemeSafari::adjustMenuListStyle(StyleResolver& styleResolver, RenderStyle& style, Element* e) const
-{
- NSControlSize controlSize = controlSizeForFont(style);
-
- style.resetBorder();
- style.resetPadding();
-
- // Height is locked to auto.
- style.setHeight(Length(Auto));
-
- // White-space is locked to pre
- style.setWhiteSpace(PRE);
-
- // Set the foreground color to black or gray when we have the aqua look.
- // Cast to RGB32 is to work around a compiler bug.
- style.setColor(e && !e->isDisabledFormControl() ? static_cast<RGBA32>(Color::black) : Color::darkGray);
-
- // Set the button's vertical size.
- setButtonSize(style);
-
- // Our font is locked to the appropriate system font size for the control. To clarify, we first use the CSS-specified font to figure out
- // a reasonable control size, but once that control size is determined, we throw that font away and use the appropriate
- // system font for the control size instead.
- setFontFromControlSize(styleResolver, style, controlSize);
-}
-
-int RenderThemeSafari::popupInternalPaddingLeft(RenderStyle& style) const
-{
- if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[leftPadding];
- if (style.appearance() == MenulistButtonPart)
- return styledPopupPaddingLeft;
- return 0;
-}
-
-int RenderThemeSafari::popupInternalPaddingRight(RenderStyle& style) const
-{
- if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[rightPadding];
- if (style.appearance() == MenulistButtonPart) {
- float fontScale = style.fontSize() / baseFontSize;
- float arrowWidth = baseArrowWidth * fontScale;
- return static_cast<int>(ceilf(arrowWidth + arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator));
- }
- return 0;
-}
-
-int RenderThemeSafari::popupInternalPaddingTop(RenderStyle& style) const
-{
- if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[topPadding];
- if (style.appearance() == MenulistButtonPart)
- return styledPopupPaddingTop;
- return 0;
-}
-
-int RenderThemeSafari::popupInternalPaddingBottom(RenderStyle& style) const
-{
- if (style.appearance() == MenulistPart)
- return popupButtonPadding(controlSizeForFont(style))[bottomPadding];
- if (style.appearance() == MenulistButtonPart)
- return styledPopupPaddingBottom;
- return 0;
-}
-
-void RenderThemeSafari::adjustMenuListButtonStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- float fontScale = style.fontSize() / baseFontSize;
-
- style.resetPadding();
- style.setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(baseBorderRadius + fontScale - 1))); // FIXME: Round up?
-
- const int minHeight = 15;
- style.setMinHeight(Length(minHeight, Fixed));
-
- style.setLineHeight(RenderStyle::initialLineHeight());
-}
-
-const IntSize* RenderThemeSafari::menuListSizes() const
-{
- static const IntSize sizes[3] = { IntSize(9, 0), IntSize(5, 0), IntSize(0, 0) };
- return sizes;
-}
-
-int RenderThemeSafari::minimumMenuListSize(RenderStyle& style) const
-{
- return sizeForSystemFont(style, menuListSizes()).width();
-}
-
-const int trackWidth = 5;
-const int trackRadius = 2;
-
-bool RenderThemeSafari::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- IntSize radius(trackRadius, trackRadius);
- FloatRoundedRect bounds(r, radius, radius, radius, radius);
-
- if (o.style().appearance() == SliderHorizontalPart)
- bounds.setRect(IntRect(r.x(), r.y() + r.height() / 2 - trackWidth / 2, r.width(), trackWidth));
- else if (o.style().appearance() == SliderVerticalPart)
- bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2, r.y(), trackWidth, r.height()));
-
- CGContextRef context = paintInfo.context().platformContext();
- CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
-
- paintInfo.context().save();
- CGContextClipToRect(context, bounds.rect());
-
- struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
- RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
- RetainPtr<CGShadingRef> mainShading;
- if (o.style().appearance() == SliderVerticalPart)
- mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(), bounds.rect().maxY()), CGPointMake(bounds.rect().maxX(), bounds.rect().maxY()), mainFunction.get(), false, false));
- else
- mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(), bounds.rect().y()), CGPointMake(bounds.rect().x(), bounds.rect().maxY()), mainFunction.get(), false, false));
-
- paintInfo.context().clipRoundedRect(bounds);
- CGContextDrawShading(context, mainShading.get());
- paintInfo.context().restore();
-
- return false;
-}
-
-void RenderThemeSafari::adjustSliderThumbStyle(StyleResolver& styleResolver, RenderStyle& style, Element* e) const
-{
- RenderTheme::adjustSliderThumbStyle(styleResolver, style, e);
- style.setBoxShadow(nullptr);
-}
-
-const float verticalSliderHeightPadding = 0.1f;
-
-bool RenderThemeSafari::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
- paintThemePart(SliderThumbPart, paintInfo.context().platformContext(), r, NSSmallControlSize, determineState(o));
- return false;
-}
-
-const int sliderThumbWidth = 15;
-const int sliderThumbHeight = 15;
-
-void RenderThemeSafari::adjustSliderThumbSize(RenderStyle& style, Element*) const
-{
- if (style.appearance() == SliderThumbHorizontalPart || style.appearance() == SliderThumbVerticalPart) {
- style.setWidth(Length(sliderThumbWidth, Fixed));
- style.setHeight(Length(sliderThumbHeight, Fixed));
- }
-#if ENABLE(VIDEO)
- else if (style.appearance() == MediaSliderThumbPart)
- RenderMediaControls::adjustMediaSliderThumbSize(style);
-#endif
-}
-
-bool RenderThemeSafari::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
-{
- ASSERT(SafariThemeLibrary());
-
- paintThemePart(SafariTheme::SearchFieldPart, paintInfo.context().platformContext(), r, controlSizeFromRect(r, searchFieldSizes()), determineState(o));
- return false;
-}
-
-const IntSize* RenderThemeSafari::searchFieldSizes() const
-{
- static const IntSize sizes[3] = { IntSize(0, 22), IntSize(0, 19), IntSize(0, 15) };
- return sizes;
-}
-
-void RenderThemeSafari::setSearchFieldSize(RenderStyle& style) const
-{
- // If the width and height are both specified, then we have nothing to do.
- if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto())
- return;
-
- // Use the font size to determine the intrinsic width of the control.
- setSizeFromFont(style, searchFieldSizes());
-}
-
-void RenderThemeSafari::adjustSearchFieldStyle(StyleResolver& styleResolver, RenderStyle& style, Element*) const
-{
- // Override border.
- style.resetBorder();
- const short borderWidth = 2;
- style.setBorderLeftWidth(borderWidth);
- style.setBorderLeftStyle(INSET);
- style.setBorderRightWidth(borderWidth);
- style.setBorderRightStyle(INSET);
- style.setBorderBottomWidth(borderWidth);
- style.setBorderBottomStyle(INSET);
- style.setBorderTopWidth(borderWidth);
- style.setBorderTopStyle(INSET);
-
- // Override height.
- style.setHeight(Length(Auto));
- setSearchFieldSize(style);
-
- // Override padding size to match AppKit text positioning.
- const int padding = 1;
- style.setPaddingLeft(Length(padding, Fixed));
- style.setPaddingRight(Length(padding, Fixed));
- style.setPaddingTop(Length(padding, Fixed));
- style.setPaddingBottom(Length(padding, Fixed));
-
- NSControlSize controlSize = controlSizeForFont(style);
- setFontFromControlSize(styleResolver, style, controlSize);
-}
-
-bool RenderThemeSafari::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
-{
- ASSERT(SafariThemeLibrary());
-
- Node* input = o.node()->shadowHost();
- if (!input)
- input = o.node();
- RenderObject* renderer = input->renderer();
- ASSERT(renderer);
-
- IntRect searchRect = renderer->absoluteBoundingBoxRectIgnoringTransforms();
-
- paintThemePart(SafariTheme::SearchFieldCancelButtonPart, paintInfo.context().platformContext(), searchRect, controlSizeFromRect(searchRect, searchFieldSizes()), determineState(o));
- return false;
-}
-
-const IntSize* RenderThemeSafari::cancelButtonSizes() const
-{
- static const IntSize sizes[3] = { IntSize(16, 13), IntSize(13, 11), IntSize(13, 9) };
- return sizes;
-}
-
-void RenderThemeSafari::adjustSearchFieldCancelButtonStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- IntSize size = sizeForSystemFont(style, cancelButtonSizes());
- style.setWidth(Length(size.width(), Fixed));
- style.setHeight(Length(size.height(), Fixed));
-}
-
-const IntSize* RenderThemeSafari::resultsButtonSizes() const
-{
- static const IntSize sizes[3] = { IntSize(19, 13), IntSize(17, 11), IntSize(17, 9) };
- return sizes;
-}
-
-const int emptyResultsOffset = 9;
-void RenderThemeSafari::adjustSearchFieldDecorationPartStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- IntSize size = sizeForSystemFont(style, resultsButtonSizes());
- style.setWidth(Length(size.width() - emptyResultsOffset, Fixed));
- style.setHeight(Length(size.height(), Fixed));
-}
-
-bool RenderThemeSafari::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&)
-{
- return false;
-}
-
-void RenderThemeSafari::adjustSearchFieldResultsDecorationPartStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- IntSize size = sizeForSystemFont(style, resultsButtonSizes());
- style.setWidth(Length(size.width(), Fixed));
- style.setHeight(Length(size.height(), Fixed));
-}
-
-bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
-{
- ASSERT(SafariThemeLibrary());
-
- Node* input = o.node()->shadowHost();
- if (!input)
- input = o.node();
- RenderObject* renderer = input->renderer();
- ASSERT(renderer);
-
- IntRect searchRect = renderer->absoluteBoundingBoxRectIgnoringTransforms();
-
- paintThemePart(SafariTheme::SearchFieldResultsDecorationPart, paintInfo.context().platformContext(), searchRect, controlSizeFromRect(searchRect, searchFieldSizes()), determineState(o));
- return false;
-}
-
-const int resultsArrowWidth = 5;
-void RenderThemeSafari::adjustSearchFieldResultsButtonStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- IntSize size = sizeForSystemFont(style, resultsButtonSizes());
- style.setWidth(Length(size.width() + resultsArrowWidth, Fixed));
- style.setHeight(Length(size.height(), Fixed));
-}
-
-bool RenderThemeSafari::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
-{
- ASSERT(SafariThemeLibrary());
-
- Node* input = o.node()->shadowHost();
- if (!input)
- input = o.node();
- RenderObject* renderer = input->renderer();
- ASSERT(renderer);
-
- IntRect searchRect = renderer->absoluteBoundingBoxRectIgnoringTransforms();
-
- paintThemePart(SafariTheme::SearchFieldResultsButtonPart, paintInfo.context().platformContext(), searchRect, controlSizeFromRect(searchRect, searchFieldSizes()), determineState(o));
- return false;
-}
-
-#if ENABLE(VIDEO)
-String RenderThemeSafari::mediaControlsStyleSheet()
-{
-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
- if (m_mediaControlsStyleSheet.isEmpty())
- m_mediaControlsStyleSheet = RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("css"));
- return m_mediaControlsStyleSheet;
-#else
- return emptyString();
-#endif
-}
-
-String RenderThemeSafari::mediaControlsScript()
-{
-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
- StringBuilder scriptBuilder;
- scriptBuilder.append(RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsLocalizedStrings"), CFSTR("js")));
- scriptBuilder.append(RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("js")));
- m_mediaControlsScript = scriptBuilder.toString();
- return m_mediaControlsScript;
-#else
- return emptyString();
-#endif
-}
-#endif
-
-#if ENABLE(METER_ELEMENT)
-void RenderThemeSafari::adjustMeterStyle(StyleResolver&, RenderStyle& style, Element*) const
-{
- style.setBoxShadow(nullptr);
-}
-
-bool RenderThemeSafari::supportsMeter(ControlPart part) const
-{
- switch (part) {
- case MeterPart:
- return true;
- default:
- return false;
- }
-}
-
-IntSize RenderThemeSafari::meterSizeForBounds(const RenderMeter&, const IntRect& bounds) const
-{
- return bounds.size();
-}
-
-bool RenderThemeSafari::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
-{
- // NOTE: This routine is for testing only. It should be fleshed out with a real CG-based implementation.
- // Right now it uses a slider, with the thumb positioned at the meter point.
- if (!is<RenderMeter>(renderObject))
- return true;
-
- HTMLMeterElement* element = downcast<RenderMeter>(renderObject).meterElement();
-
- int remaining = static_cast<int>((1.0 - element->valueRatio()) * static_cast<double>(rect.size().width()));
-
- // Draw the background
- paintSliderTrack(renderObject, paintInfo, rect);
-
- // Draw the progress portion
- IntRect completedRect(rect);
- completedRect.contract(remaining, 0);
-
- paintSliderThumb(renderObject, paintInfo, completedRect);
-
- return true;
-}
-
-#endif
-
-} // namespace WebCore
-
-#endif // #if USE(SAFARI_THEME)
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeSafarih"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/RenderThemeSafari.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeSafari.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -1,191 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013, 2014 Apple Inc.
- * Copyright (C) 2009 Kenneth Rohde Christiansen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef RenderThemeSafari_h
-#define RenderThemeSafari_h
-
-#if USE(SAFARI_THEME)
-
-#include "RenderTheme.h"
-
-// If you have an empty placeholder SafariThemeConstants.h, then include SafariTheme.h
-// This is a workaround until a version of WebKitSupportLibrary is released with an updated SafariThemeConstants.h
-#include <SafariTheme/SafariThemeConstants.h>
-#ifndef SafariThemeConstants_h
-#include <SafariTheme/SafariTheme.h>
-#endif
-
-#if PLATFORM(WIN)
-typedef void* HANDLE;
-typedef struct HINSTANCE__* HINSTANCE;
-typedef HINSTANCE HMODULE;
-#endif
-
-namespace WebCore {
-
-using namespace SafariTheme;
-
-class RenderStyle;
-
-class RenderThemeSafari : public RenderTheme {
-public:
- static Ref<RenderTheme> create();
-
- // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline
- // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
- // controls that need to do this.
- virtual int baselinePosition(const RenderBox&) const;
-
- // A method asking if the control changes its tint when the window has focus or not.
- virtual bool controlSupportsTints(const RenderObject&) const;
-
- // A general method asking if any control tinting is supported at all.
- virtual bool supportsControlTints() const { return true; }
-
- virtual void adjustRepaintRect(const RenderObject&, IntRect&);
-
- virtual bool isControlStyled(const RenderStyle&, const BorderData&,
- const FillLayer&, const Color& backgroundColor) const;
-
- virtual Color platformActiveSelectionBackgroundColor() const;
- virtual Color platformInactiveSelectionBackgroundColor() const;
- virtual Color activeListBoxSelectionBackgroundColor() const;
-
- virtual Color platformFocusRingColor() const;
-
- virtual int minimumMenuListSize(RenderStyle&) const;
-
- virtual void adjustSliderThumbSize(RenderStyle&, Element*) const;
- virtual void adjustSliderThumbStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual int popupInternalPaddingLeft(RenderStyle&) const;
- virtual int popupInternalPaddingRight(RenderStyle&) const;
- virtual int popupInternalPaddingTop(RenderStyle&) const;
- virtual int popupInternalPaddingBottom(RenderStyle&) const;
-
-protected:
- // System fonts.
- virtual void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const override;
-
- // Methods for each appearance value.
- virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void setCheckboxSize(RenderStyle&) const;
-
- virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void setRadioSize(RenderStyle&) const;
-
- virtual void adjustButtonStyle(StyleResolver&, RenderStyle&, Element*) const;
- virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void setButtonSize(RenderStyle&) const;
-
- virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void adjustTextFieldStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void adjustTextAreaStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void adjustMenuListStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&);
- virtual void adjustMenuListButtonStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
-
- virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
- virtual void adjustSearchFieldStyle(StyleResolver&, RenderStyle&, Element*) const;
-
- virtual void adjustSearchFieldCancelButtonStyle(StyleResolver&, RenderStyle&, Element*) const;
- virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
-
- virtual void adjustSearchFieldDecorationPartStyle(StyleResolver&, RenderStyle&, Element*) const;
- virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
-
- virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver&, RenderStyle&, Element*) const;
- virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
-
- virtual void adjustSearchFieldResultsButtonStyle(StyleResolver&, RenderStyle&, Element*) const;
- virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
-
- virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&);
-
-#if ENABLE(VIDEO)
- virtual String mediaControlsStyleSheet() override;
- virtual String mediaControlsScript() override;
-#endif
-
-#if ENABLE(METER_ELEMENT)
- virtual IntSize meterSizeForBounds(const RenderMeter&, const IntRect&) const override;
- virtual bool supportsMeter(ControlPart) const override;
- virtual void adjustMeterStyle(StyleResolver&, RenderStyle&, Element*) const override;
- virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
-#endif
-
-private:
- RenderThemeSafari();
- virtual ~RenderThemeSafari();
-
- IntRect inflateRect(const IntRect&, const IntSize&, const int* margins) const;
-
- // Get the control size based off the font. Used by some of the controls (like buttons).
-
- NSControlSize controlSizeForFont(RenderStyle&) const;
- NSControlSize controlSizeForSystemFont(RenderStyle&) const;
- //void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize);
- void setSizeFromFont(RenderStyle&, const IntSize* sizes) const;
- IntSize sizeForFont(RenderStyle&, const IntSize* sizes) const;
- IntSize sizeForSystemFont(RenderStyle&, const IntSize* sizes) const;
- void setFontFromControlSize(StyleResolver&, RenderStyle&, NSControlSize) const;
-
- // Helpers for adjusting appearance and for painting
- const IntSize* checkboxSizes() const;
- const int* checkboxMargins(NSControlSize) const;
-
- const IntSize* radioSizes() const;
- const int* radioMargins(NSControlSize) const;
-
- void setButtonPaddingFromControlSize(RenderStyle&, NSControlSize) const;
- const IntSize* buttonSizes() const;
- const int* buttonMargins(NSControlSize) const;
-
- const IntSize* popupButtonSizes() const;
- const int* popupButtonMargins(NSControlSize) const;
- const int* popupButtonPadding(NSControlSize) const;
- void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&);
- const IntSize* menuListSizes() const;
-
- const IntSize* searchFieldSizes() const;
- const IntSize* cancelButtonSizes() const;
- const IntSize* resultsButtonSizes() const;
- void setSearchFieldSize(RenderStyle&) const;
-
- ThemeControlState determineState(const RenderObject&) const;
-
- String m_mediaControlsScript;
- String m_mediaControlsStyleSheet;
-};
-
-} // namespace WebCore
-
-#endif // #if USE(SAFARI_THEME)
-
-#endif // RenderThemeSafari_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFEImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h (191866 => 191867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h        2015-11-02 00:10:21 UTC (rev 191866)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h        2015-11-02 00:16:36 UTC (rev 191867)
</span><span class="lines">@@ -38,9 +38,6 @@
</span><span class="cx"> static Ref<FEImage> createWithIRIReference(Filter&, Document&, const String&, const SVGPreserveAspectRatio&);
</span><span class="cx">
</span><span class="cx"> virtual void platformApplySoftware() override;
</span><del>-#if ENABLE(OPENCL)
- virtual bool platformApplyOpenCL();
-#endif
</del><span class="cx"> virtual void dump() override;
</span><span class="cx">
</span><span class="cx"> virtual void determineAbsolutePaintRect() override;
</span></span></pre>
</div>
</div>
</body>
</html>