<!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>[169948] trunk/Source/WebCore</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/169948">169948</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-06-13 14:13:43 -0700 (Fri, 13 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Convert LayerPool and TileCoverageMap from ObjC to C++
https://bugs.webkit.org/show_bug.cgi?id=133862
<rdar://problem/17302883>
Reviewed by Simon Fraser.
This just moves two ObjC files from the mac subdirectory to the parent and
revises the project to build them as C++.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ca/LayerPool.cpp: Copied from platform/graphics/ca/mac/LayerPool.mm.
* platform/graphics/ca/LayerPool.h: Copied from platform/graphics/ca/mac/LayerPool.h.
* platform/graphics/ca/TileCoverageMap.cpp: Copied from platform/graphics/ca/mac/TileCoverageMap.mm.
* platform/graphics/ca/TileCoverageMap.h: Copied from platform/graphics/ca/mac/TileCoverageMap.h.
* platform/graphics/ca/mac/LayerPool.h: Removed.
* platform/graphics/ca/mac/LayerPool.mm: Removed.
* platform/graphics/ca/mac/TileCoverageMap.h: Removed.
* platform/graphics/ca/mac/TileCoverageMap.mm: Removed.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscaLayerPoolcpp">trunk/Source/WebCore/platform/graphics/ca/LayerPool.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaLayerPoolh">trunk/Source/WebCore/platform/graphics/ca/LayerPool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileCoverageMapcpp">trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileCoverageMaph">trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacLayerPoolh">trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacLayerPoolmm">trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacTileCoverageMaph">trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacTileCoverageMapmm">trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/ChangeLog        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-06-13 Brent Fulgham <bfulgham@apple.com>
+
+ Convert LayerPool and TileCoverageMap from ObjC to C++
+ https://bugs.webkit.org/show_bug.cgi?id=133862
+ <rdar://problem/17302883>
+
+ Reviewed by Simon Fraser.
+
+ This just moves two ObjC files from the mac subdirectory to the parent and
+ revises the project to build them as C++.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/ca/LayerPool.cpp: Copied from platform/graphics/ca/mac/LayerPool.mm.
+ * platform/graphics/ca/LayerPool.h: Copied from platform/graphics/ca/mac/LayerPool.h.
+ * platform/graphics/ca/TileCoverageMap.cpp: Copied from platform/graphics/ca/mac/TileCoverageMap.mm.
+ * platform/graphics/ca/TileCoverageMap.h: Copied from platform/graphics/ca/mac/TileCoverageMap.h.
+ * platform/graphics/ca/mac/LayerPool.h: Removed.
+ * platform/graphics/ca/mac/LayerPool.mm: Removed.
+ * platform/graphics/ca/mac/TileCoverageMap.h: Removed.
+ * platform/graphics/ca/mac/TileCoverageMap.mm: Removed.
+
</ins><span class="cx"> 2014-06-13 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Make css jit compile for armv7.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -2349,6 +2349,10 @@
</span><span class="cx">                 7AA3A69A194A64E7001CBD24 /* TileController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A696194A64E7001CBD24 /* TileController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7AA3A69B194A64E7001CBD24 /* TileGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA3A697194A64E7001CBD24 /* TileGrid.cpp */; };
</span><span class="cx">                 7AA3A69C194A64E7001CBD24 /* TileGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A698194A64E7001CBD24 /* TileGrid.h */; };
</span><ins>+                7AA3A69F194B59B6001CBD24 /* LayerPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */; };
+                7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A69E194B59B6001CBD24 /* LayerPool.h */; };
+                7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA3A6A1194B5C22001CBD24 /* TileCoverageMap.cpp */; };
+                7AA3A6A4194B5C22001CBD24 /* TileCoverageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */; };
</ins><span class="cx">                 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */; };
</span><span class="cx">                 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AABA25814BC613300AA9A11 /* DOMEditor.h */; };
</span><span class="cx">                 7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */; };
</span><span class="lines">@@ -3346,8 +3350,6 @@
</span><span class="cx">                 93F1D5C112D5335600832BEC /* JSWebGLLoseContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F1D5BF12D5335600832BEC /* JSWebGLLoseContext.h */; };
</span><span class="cx">                 93F6F1ED127F70B10055CB06 /* WebGLContextEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F6F1EA127F70B10055CB06 /* WebGLContextEvent.cpp */; };
</span><span class="cx">                 93F6F1EE127F70B10055CB06 /* WebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F6F1EB127F70B10055CB06 /* WebGLContextEvent.h */; };
</span><del>-                93F72AF31666EDFC002A02BD /* LayerPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F72AF11666EDFC002A02BD /* LayerPool.h */; };
-                93F72AF41666EDFC002A02BD /* LayerPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F72AF21666EDFC002A02BD /* LayerPool.mm */; };
</del><span class="cx">                 93F925430F7EF5B8007E37C9 /* CheckedRadioButtons.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F925410F7EF5B8007E37C9 /* CheckedRadioButtons.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93F925440F7EF5B8007E37C9 /* CheckedRadioButtons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F925420F7EF5B8007E37C9 /* CheckedRadioButtons.cpp */; };
</span><span class="cx">                 93F9B6570BA0F35E00854064 /* DOMHTMLCanvasElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93F9B6540BA0F35E00854064 /* DOMHTMLCanvasElement.mm */; };
</span><span class="lines">@@ -6123,8 +6125,6 @@
</span><span class="cx">                 E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */; };
</span><span class="cx">                 E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E47E276816036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47E276716036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp */; };
</span><del>-                E4830A3918F4C59400154A1B /* TileCoverageMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4830A3818F4C59400154A1B /* TileCoverageMap.mm */; };
-                E4830A3D18F4C5B700154A1B /* TileCoverageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E4830A3C18F4C5B700154A1B /* TileCoverageMap.h */; };
</del><span class="cx">                 E48944A2180B57D800F165D8 /* SimpleLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */; };
</span><span class="cx">                 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E4946EAE156E64DD00D3297F /* StyleRuleImport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */; };
</span><span class="lines">@@ -9455,6 +9455,10 @@
</span><span class="cx">                 7AA3A696194A64E7001CBD24 /* TileController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileController.h; path = ca/TileController.h; sourceTree = "<group>"; };
</span><span class="cx">                 7AA3A697194A64E7001CBD24 /* TileGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TileGrid.cpp; path = ca/TileGrid.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7AA3A698194A64E7001CBD24 /* TileGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileGrid.h; path = ca/TileGrid.h; sourceTree = "<group>"; };
</span><ins>+                7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LayerPool.cpp; path = ca/LayerPool.cpp; sourceTree = "<group>"; };
+                7AA3A69E194B59B6001CBD24 /* LayerPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerPool.h; path = ca/LayerPool.h; sourceTree = "<group>"; };
+                7AA3A6A1194B5C22001CBD24 /* TileCoverageMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TileCoverageMap.cpp; path = ca/TileCoverageMap.cpp; sourceTree = "<group>"; };
+                7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileCoverageMap.h; path = ca/TileCoverageMap.h; sourceTree = "<group>"; };
</ins><span class="cx">                 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMEditor.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7AABA25814BC613300AA9A11 /* DOMEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMEditor.h; sourceTree = "<group>"; };
</span><span class="cx">                 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10434,8 +10438,6 @@
</span><span class="cx">                 93F6F1EA127F70B10055CB06 /* WebGLContextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLContextEvent.cpp; path = canvas/WebGLContextEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 93F6F1EB127F70B10055CB06 /* WebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLContextEvent.h; path = canvas/WebGLContextEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 93F6F1EC127F70B10055CB06 /* WebGLContextEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLContextEvent.idl; path = canvas/WebGLContextEvent.idl; sourceTree = "<group>"; };
</span><del>-                93F72AF11666EDFC002A02BD /* LayerPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerPool.h; path = ca/mac/LayerPool.h; sourceTree = "<group>"; };
-                93F72AF21666EDFC002A02BD /* LayerPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayerPool.mm; path = ca/mac/LayerPool.mm; sourceTree = "<group>"; };
</del><span class="cx">                 93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGenerator.pm; path = scripts/CodeGenerator.pm; sourceTree = "<group>"; };
</span><span class="cx">                 93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGeneratorJS.pm; path = ../scripts/CodeGeneratorJS.pm; sourceTree = "<group>"; wrapsLines = 0; };
</span><span class="cx">                 93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "generate-bindings.pl"; path = "scripts/generate-bindings.pl"; sourceTree = "<group>"; };
</span><span class="lines">@@ -13585,8 +13587,6 @@
</span><span class="cx">                 E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceHandle.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentStyleSheetCollection.h; sourceTree = "<group>"; };
</span><span class="cx">                 E47E276716036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStyleSheetCollection.cpp; sourceTree = "<group>"; };
</span><del>-                E4830A3818F4C59400154A1B /* TileCoverageMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileCoverageMap.mm; path = ca/mac/TileCoverageMap.mm; sourceTree = "<group>"; };
-                E4830A3C18F4C5B700154A1B /* TileCoverageMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileCoverageMap.h; path = ca/mac/TileCoverageMap.h; sourceTree = "<group>"; };
</del><span class="cx">                 E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = "<group>"; };
</span><span class="cx">                 E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRuleImport.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -15784,16 +15784,12 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */,
</span><del>-                                93F72AF11666EDFC002A02BD /* LayerPool.h */,
-                                93F72AF21666EDFC002A02BD /* LayerPool.mm */,
</del><span class="cx">                                 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */,
</span><span class="cx">                                 4958781F12A57DDF007238AC /* PlatformCAAnimationMac.mm */,
</span><span class="cx">                                 D66B2D5B186830050073C4DD /* PlatformCAFiltersMac.h */,
</span><span class="cx">                                 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */,
</span><span class="cx">                                 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */,
</span><span class="cx">                                 4958782012A57DDF007238AC /* PlatformCALayerMac.mm */,
</span><del>-                                E4830A3C18F4C5B700154A1B /* TileCoverageMap.h */,
-                                E4830A3818F4C59400154A1B /* TileCoverageMap.mm */,
</del><span class="cx">                                 0F580FA11496939100FB5BD8 /* WebTiledBackingLayer.h */,
</span><span class="cx">                                 0F580FA21496939100FB5BD8 /* WebTiledBackingLayer.mm */,
</span><span class="cx">                         );
</span><span class="lines">@@ -15832,6 +15828,8 @@
</span><span class="cx">                                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */,
</span><span class="cx">                                 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */,
</span><span class="cx">                                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */,
</span><ins>+                                7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */,
+                                7AA3A69E194B59B6001CBD24 /* LayerPool.h */,
</ins><span class="cx">                                 499B3EDC128DB50100E726C2 /* PlatformCAAnimation.h */,
</span><span class="cx">                                 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */,
</span><span class="cx">                                 2D70BA1418074F850001908A /* PlatformCALayer.cpp */,
</span><span class="lines">@@ -15839,6 +15837,8 @@
</span><span class="cx">                                 493E5E0812D6420500020081 /* PlatformCALayerClient.h */,
</span><span class="cx">                                 7AA3A695194A64E7001CBD24 /* TileController.cpp */,
</span><span class="cx">                                 7AA3A696194A64E7001CBD24 /* TileController.h */,
</span><ins>+                                7AA3A6A1194B5C22001CBD24 /* TileCoverageMap.cpp */,
+                                7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */,
</ins><span class="cx">                                 7AA3A697194A64E7001CBD24 /* TileGrid.cpp */,
</span><span class="cx">                                 7AA3A698194A64E7001CBD24 /* TileGrid.h */,
</span><span class="cx">                                 494BC40C12AEDD9E00743BD2 /* TransformationMatrixCA.cpp */,
</span><span class="lines">@@ -23749,6 +23749,7 @@
</span><span class="cx">                                 85BA4D0F0AA688680088052D /* DOMHTMLDListElement.h in Headers */,
</span><span class="cx">                                 85E711A50AC5D5350053270F /* DOMHTMLDListElementInternal.h in Headers */,
</span><span class="cx">                                 85BCBC130ABBA87D00381160 /* DOMHTMLDocument.h in Headers */,
</span><ins>+                                7AA3A6A4194B5C22001CBD24 /* TileCoverageMap.h in Headers */,
</ins><span class="cx">                                 85E711A60AC5D5350053270F /* DOMHTMLDocumentInternal.h in Headers */,
</span><span class="cx">                                 85DF2EED0AA387CB00AD64C5 /* DOMHTMLElement.h in Headers */,
</span><span class="cx">                                 85E711A70AC5D5350053270F /* DOMHTMLElementInternal.h in Headers */,
</span><span class="lines">@@ -24932,7 +24933,6 @@
</span><span class="cx">                                 B2FA3DB70AB75A6F000E5AC4 /* JSSVGPathSeg.h in Headers */,
</span><span class="cx">                                 B2FA3DB90AB75A6F000E5AC4 /* JSSVGPathSegArcAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DBB0AB75A6F000E5AC4 /* JSSVGPathSegArcRel.h in Headers */,
</span><del>-                                E4830A3D18F4C5B700154A1B /* TileCoverageMap.h in Headers */,
</del><span class="cx">                                 B2FA3DBD0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.h in Headers */,
</span><span class="cx">                                 B2FA3DBF0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DC10AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.h in Headers */,
</span><span class="lines">@@ -25073,7 +25073,6 @@
</span><span class="cx">                                 85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */,
</span><span class="cx">                                 2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */,
</span><span class="cx">                                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
</span><del>-                                93F72AF31666EDFC002A02BD /* LayerPool.h in Headers */,
</del><span class="cx">                                 141DC050164834B900371E5A /* LayoutBoxExtent.h in Headers */,
</span><span class="cx">                                 931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */,
</span><span class="cx">                                 141DC051164834B900371E5A /* LayoutPoint.h in Headers */,
</span><span class="lines">@@ -26197,6 +26196,7 @@
</span><span class="cx">                                 C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */,
</span><span class="cx">                                 B2C3DA490D006C1D00EF6F26 /* TextEncodingRegistry.h in Headers */,
</span><span class="cx">                                 933A14300B7D188600A53FFD /* TextEvent.h in Headers */,
</span><ins>+                                7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */,
</ins><span class="cx">                                 A77B41A012E675A90054343D /* TextEventInputType.h in Headers */,
</span><span class="cx">                                 F55B3DD81251F12D003EF269 /* TextFieldInputType.h in Headers */,
</span><span class="cx">                                 93309E18099E64920056E581 /* TextGranularity.h in Headers */,
</span><span class="lines">@@ -27133,7 +27133,6 @@
</span><span class="cx">                                 E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */,
</span><span class="cx">                                 E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */,
</span><span class="cx">                                 2D3EF4491917915C00034184 /* WebActionDisablingCALayerDelegate.mm in Sources */,
</span><del>-                                E4830A3918F4C59400154A1B /* TileCoverageMap.mm in Sources */,
</del><span class="cx">                                 E164FAA518315E1A00DB4E61 /* CryptoKeyRSAMac.cpp in Sources */,
</span><span class="cx">                                 E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */,
</span><span class="cx">                                 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */,
</span><span class="lines">@@ -27347,6 +27346,7 @@
</span><span class="cx">                                 85BCBC140ABBA87D00381160 /* DOMHTMLDocument.mm in Sources */,
</span><span class="cx">                                 85DF2EEE0AA387CB00AD64C5 /* DOMHTMLElement.mm in Sources */,
</span><span class="cx">                                 85C050BB0AD84F5E005532E7 /* DOMHTMLEmbedElement.mm in Sources */,
</span><ins>+                                7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */,
</ins><span class="cx">                                 85BA4CE00AA6861B0088052D /* DOMHTMLFieldSetElement.mm in Sources */,
</span><span class="cx">                                 85ECBEF00AA7626900544F0B /* DOMHTMLFontElement.mm in Sources */,
</span><span class="cx">                                 85DF2C5D0AA341F600AD64C5 /* DOMHTMLFormElement.mm in Sources */,
</span><span class="lines">@@ -28613,7 +28613,6 @@
</span><span class="cx">                                 9352084509BD43B900F2038D /* Language.mm in Sources */,
</span><span class="cx">                                 2917B5611473496C0052C9D0 /* LayerFlushScheduler.cpp in Sources */,
</span><span class="cx">                                 2917B566147349950052C9D0 /* LayerFlushSchedulerMac.cpp in Sources */,
</span><del>-                                93F72AF41666EDFC002A02BD /* LayerPool.mm in Sources */,
</del><span class="cx">                                 141DC04F164834B900371E5A /* LayoutBoxExtent.cpp in Sources */,
</span><span class="cx">                                 141DC052164834B900371E5A /* LayoutRect.cpp in Sources */,
</span><span class="cx">                                 A120ACA413F998CA00FE4AC7 /* LayoutRepainter.cpp in Sources */,
</span><span class="lines">@@ -29069,6 +29068,7 @@
</span><span class="cx">                                 078E090A17D14CEE00420AA1 /* RTCIceCandidateEvent.cpp in Sources */,
</span><span class="cx">                                 078E090B17D14CEE00420AA1 /* RTCPeerConnection.cpp in Sources */,
</span><span class="cx">                                 073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */,
</span><ins>+                                7AA3A69F194B59B6001CBD24 /* LayerPool.cpp in Sources */,
</ins><span class="cx">                                 078E090C17D14CEE00420AA1 /* RTCSessionDescription.cpp in Sources */,
</span><span class="cx">                                 073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */,
</span><span class="cx">                                 078E090D17D14CEE00420AA1 /* RTCSessionDescriptionRequestImpl.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaLayerPoolcppfromrev169923trunkSourceWebCoreplatformgraphicscamacLayerPoolmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/LayerPool.cpp (from rev 169923, trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm) (0 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/LayerPool.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerPool.cpp        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2014 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 "LayerPool.h"
+
+#include "Logging.h"
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+static const double capacityDecayTime = 5;
+
+LayerPool::LayerPool()
+ : m_totalBytes(0)
+ , m_maxBytesForPool(48 * 1024 * 1024)
+ , m_pruneTimer(this, &LayerPool::pruneTimerFired)
+ , m_lastAddTime(0)
+{
+}
+
+LayerPool* LayerPool::sharedPool()
+{
+ static LayerPool* sharedPool = new LayerPool;
+ return sharedPool;
+}
+
+unsigned LayerPool::backingStoreBytesForSize(const IntSize& size)
+{
+ return size.width() * size.height() * 4;
+}
+
+LayerPool::LayerList& LayerPool::listOfLayersWithSize(const IntSize& size, AccessType accessType)
+{
+ HashMap<IntSize, LayerList>::iterator it = m_reuseLists.find(size);
+ if (it == m_reuseLists.end()) {
+ it = m_reuseLists.add(size, LayerList()).iterator;
+ m_sizesInPruneOrder.append(size);
+ } else if (accessType == MarkAsUsed) {
+ m_sizesInPruneOrder.remove(m_sizesInPruneOrder.reverseFind(size));
+ m_sizesInPruneOrder.append(size);
+ }
+ return it->value;
+}
+
+void LayerPool::addLayer(const RefPtr<PlatformCALayer>& layer)
+{
+ IntSize layerSize(expandedIntSize(layer->bounds().size()));
+ if (!canReuseLayerWithSize(layerSize))
+ return;
+
+ listOfLayersWithSize(layerSize).prepend(layer);
+ m_totalBytes += backingStoreBytesForSize(layerSize);
+
+ m_lastAddTime = monotonicallyIncreasingTime();
+ schedulePrune();
+}
+
+RefPtr<PlatformCALayer> LayerPool::takeLayerWithSize(const IntSize& size)
+{
+ if (!canReuseLayerWithSize(size))
+ return nil;
+ LayerList& reuseList = listOfLayersWithSize(size, MarkAsUsed);
+ if (reuseList.isEmpty())
+ return nil;
+ m_totalBytes -= backingStoreBytesForSize(size);
+ return reuseList.takeFirst();
+}
+
+unsigned LayerPool::decayedCapacity() const
+{
+ // Decay to one quarter over capacityDecayTime
+ double timeSinceLastAdd = monotonicallyIncreasingTime() - m_lastAddTime;
+ if (timeSinceLastAdd > capacityDecayTime)
+ return m_maxBytesForPool / 4;
+ float decayProgess = float(timeSinceLastAdd / capacityDecayTime);
+ return m_maxBytesForPool / 4 + m_maxBytesForPool * 3 / 4 * (1 - decayProgess);
+}
+
+void LayerPool::schedulePrune()
+{
+ if (m_pruneTimer.isActive())
+ return;
+ m_pruneTimer.startOneShot(1);
+}
+
+void LayerPool::pruneTimerFired(Timer<LayerPool>&)
+{
+ unsigned shrinkTo = decayedCapacity();
+ while (m_totalBytes > shrinkTo) {
+ ASSERT(!m_sizesInPruneOrder.isEmpty());
+ IntSize sizeToDrop = m_sizesInPruneOrder.first();
+ LayerList& oldestReuseList = m_reuseLists.find(sizeToDrop)->value;
+ if (oldestReuseList.isEmpty()) {
+ m_reuseLists.remove(sizeToDrop);
+ m_sizesInPruneOrder.remove(0);
+ continue;
+ }
+
+ m_totalBytes -= backingStoreBytesForSize(sizeToDrop);
+ // The last element in the list is the oldest, hence most likely not to
+ // still have a backing store.
+ oldestReuseList.remove(--oldestReuseList.end());
+ }
+ if (monotonicallyIncreasingTime() - m_lastAddTime <= capacityDecayTime)
+ schedulePrune();
+}
+
+void LayerPool::drain()
+{
+ m_reuseLists.clear();
+ m_sizesInPruneOrder.clear();
+ m_totalBytes = 0;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaLayerPoolhfromrev169923trunkSourceWebCoreplatformgraphicscamacLayerPoolh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/LayerPool.h (from rev 169923, trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.h) (0 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/LayerPool.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerPool.h        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2014 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. AND ITS CONTRIBUTORS ``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 ITS 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 LayerPool_h
+#define LayerPool_h
+
+#include "IntSize.h"
+#include "IntSizeHash.h"
+#include "PlatformCALayer.h"
+#include "Timer.h"
+#include <wtf/Deque.h>
+#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class LayerPool {
+ WTF_MAKE_NONCOPYABLE(LayerPool);
+public:
+ static LayerPool* sharedPool();
+
+ void addLayer(const RefPtr<PlatformCALayer>&);
+ RefPtr<PlatformCALayer> takeLayerWithSize(const IntSize&);
+
+ void drain();
+
+ // The maximum size of all queued layers in bytes.
+ unsigned capacity() const { return m_maxBytesForPool; }
+
+private:
+ LayerPool();
+
+ typedef Deque<RefPtr<PlatformCALayer>> LayerList;
+
+ unsigned decayedCapacity() const;
+
+ bool canReuseLayerWithSize(const IntSize& size) const { return m_maxBytesForPool && !size.isEmpty(); }
+ void schedulePrune();
+ void pruneTimerFired(Timer<LayerPool>&);
+
+ typedef enum { LeaveUnchanged, MarkAsUsed } AccessType;
+ LayerList& listOfLayersWithSize(const IntSize&, AccessType = LeaveUnchanged);
+
+ static unsigned backingStoreBytesForSize(const IntSize&);
+
+ HashMap<IntSize, LayerList> m_reuseLists;
+ // Ordered by recent use. The last size is the most recently used.
+ Vector<IntSize> m_sizesInPruneOrder;
+ unsigned m_totalBytes;
+ unsigned m_maxBytesForPool;
+
+ Timer<LayerPool> m_pruneTimer;
+
+ double m_lastAddTime;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileCoverageMapcppfromrev169923trunkSourceWebCoreplatformgraphicscamacTileCoverageMapmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp (from rev 169923, trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.mm) (0 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2011-2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#import "config.h"
+#import "TileCoverageMap.h"
+
+#import "GraphicsContext.h"
+#import "TileController.h"
+#import "TileGrid.h"
+
+namespace WebCore {
+
+TileCoverageMap::TileCoverageMap(const TileController& controller)
+ : m_controller(controller)
+ , m_layer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this))
+ , m_visibleRectIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
+ , m_position(FloatPoint(0, controller.topContentInset()))
+{
+ m_layer.get().setOpacity(0.75);
+ m_layer.get().setAnchorPoint(FloatPoint3D());
+ m_layer.get().setBorderColor(Color::black);
+ m_layer.get().setBorderWidth(1);
+ m_layer.get().setPosition(FloatPoint(2, 2));
+ m_layer.get().setContentsScale(m_controller.deviceScaleFactor());
+ m_visibleRectIndicatorLayer.get().setBorderWidth(2);
+ m_visibleRectIndicatorLayer.get().setAnchorPoint(FloatPoint3D());
+ m_visibleRectIndicatorLayer.get().setBorderColor(Color(255, 0, 0));
+
+ m_layer.get().appendSublayer(&m_visibleRectIndicatorLayer.get());
+
+ update();
+}
+
+TileCoverageMap::~TileCoverageMap()
+{
+ m_layer.get().setOwner(nullptr);
+}
+
+void TileCoverageMap::update()
+{
+ FloatRect containerBounds = m_controller.bounds();
+ FloatRect visibleRect = m_controller.visibleRect();
+ visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges.
+ visibleRect.setHeight(visibleRect.height() - m_controller.topContentInset());
+
+ float widthScale = 1;
+ float scale = 1;
+ if (!containerBounds.isEmpty()) {
+ widthScale = std::min<float>(visibleRect.width() / containerBounds.width(), 0.1);
+ scale = std::min(widthScale, visibleRect.height() / containerBounds.height());
+ }
+
+ float indicatorScale = scale * m_controller.tileGrid().scale();
+ FloatRect mapBounds = containerBounds;
+ mapBounds.scale(indicatorScale, indicatorScale);
+
+ m_layer.get().setPosition(m_position + FloatPoint(2, 2));
+ m_layer.get().setBounds(mapBounds);
+ m_layer.get().setNeedsDisplay();
+
+ visibleRect.scale(indicatorScale, indicatorScale);
+ visibleRect.expand(2, 2);
+ m_visibleRectIndicatorLayer->setPosition(visibleRect.location());
+ m_visibleRectIndicatorLayer->setBounds(FloatRect(FloatPoint(), visibleRect.size()));
+
+ Color visibleRectIndicatorColor;
+ switch (m_controller.indicatorMode()) {
+ case SynchronousScrollingBecauseOfStyleIndication:
+ visibleRectIndicatorColor = Color(255, 0, 0);
+ break;
+ case SynchronousScrollingBecauseOfEventHandlersIndication:
+ visibleRectIndicatorColor = Color(255, 255, 0);
+ break;
+ case AsyncScrollingIndication:
+ visibleRectIndicatorColor = Color(0, 200, 0);
+ break;
+ }
+
+ m_visibleRectIndicatorLayer.get().setBorderColor(visibleRectIndicatorColor);
+}
+
+void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&)
+{
+ ASSERT_UNUSED(platformCALayer, platformCALayer == &m_layer.get());
+ m_controller.tileGrid().drawTileMapContents(context.platformContext(), m_layer.get().bounds());
+}
+
+float TileCoverageMap::platformCALayerDeviceScaleFactor() const
+{
+ return m_controller.rootLayer().owner()->platformCALayerDeviceScaleFactor();
+}
+
+void TileCoverageMap::setDeviceScaleFactor(float deviceScaleFactor)
+{
+ m_layer.get().setContentsScale(deviceScaleFactor);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileCoverageMaphfromrev169923trunkSourceWebCoreplatformgraphicscamacTileCoverageMaph"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h (from rev 169923, trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.h) (0 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.h        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2011-2014 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. AND ITS CONTRIBUTORS ``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 ITS 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 TileCoverageMap_h
+#define TileCoverageMap_h
+
+#include "FloatRect.h"
+#include "IntRect.h"
+#include "PlatformCALayer.h"
+#include "PlatformCALayerClient.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RetainPtr.h>
+
+namespace WebCore {
+
+class FloatRect;
+class IntPoint;
+class IntRect;
+class TileController;
+
+class TileCoverageMap : public PlatformCALayerClient {
+ WTF_MAKE_NONCOPYABLE(TileCoverageMap); WTF_MAKE_FAST_ALLOCATED;
+public:
+ TileCoverageMap(const TileController&);
+ ~TileCoverageMap();
+
+ void update();
+ void setPosition(const FloatPoint& position) { m_position = position; }
+
+ PlatformCALayer& layer() { return m_layer.get(); }
+
+ void setDeviceScaleFactor(float);
+
+private:
+ // PlatformCALayerClient
+ virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesTopDown; }
+ virtual bool platformCALayerContentsOpaque() const override { return true; }
+ virtual bool platformCALayerDrawsContent() const override { return true; }
+ virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) override;
+ virtual float platformCALayerDeviceScaleFactor() const override;
+
+ const TileController& m_controller;
+
+ Ref<PlatformCALayer> m_layer;
+ Ref<PlatformCALayer> m_visibleRectIndicatorLayer;
+
+ FloatPoint m_position;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacLayerPoolh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.h (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.h        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.h        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 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. AND ITS CONTRIBUTORS ``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 ITS 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 LayerPool_h
-#define LayerPool_h
-
-#include "IntSize.h"
-#include "IntSizeHash.h"
-#include "PlatformCALayer.h"
-#include "Timer.h"
-#include <wtf/Deque.h>
-#include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class LayerPool {
- WTF_MAKE_NONCOPYABLE(LayerPool);
-public:
- static LayerPool* sharedPool();
-
- void addLayer(const RefPtr<PlatformCALayer>&);
- RefPtr<PlatformCALayer> takeLayerWithSize(const IntSize&);
-
- void drain();
-
- // The maximum size of all queued layers in bytes.
- unsigned capacity() const { return m_maxBytesForPool; }
-
-private:
- LayerPool();
-
- typedef Deque<RefPtr<PlatformCALayer>> LayerList;
-
- unsigned decayedCapacity() const;
-
- bool canReuseLayerWithSize(const IntSize& size) const { return m_maxBytesForPool && !size.isEmpty(); }
- void schedulePrune();
- void pruneTimerFired(Timer<LayerPool>&);
-
- typedef enum { LeaveUnchanged, MarkAsUsed } AccessType;
- LayerList& listOfLayersWithSize(const IntSize&, AccessType = LeaveUnchanged);
-
- static unsigned backingStoreBytesForSize(const IntSize&);
-
- HashMap<IntSize, LayerList> m_reuseLists;
- // Ordered by recent use. The last size is the most recently used.
- Vector<IntSize> m_sizesInPruneOrder;
- unsigned m_totalBytes;
- unsigned m_maxBytesForPool;
-
- Timer<LayerPool> m_pruneTimer;
-
- double m_lastAddTime;
-};
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacLayerPoolmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -1,138 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 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 "LayerPool.h"
-
-#include "Logging.h"
-#include <wtf/CurrentTime.h>
-
-namespace WebCore {
-
-static const double capacityDecayTime = 5;
-
-LayerPool::LayerPool()
- : m_totalBytes(0)
- , m_maxBytesForPool(48 * 1024 * 1024)
- , m_pruneTimer(this, &LayerPool::pruneTimerFired)
- , m_lastAddTime(0)
-{
-}
-
-LayerPool* LayerPool::sharedPool()
-{
- static LayerPool* sharedPool = new LayerPool;
- return sharedPool;
-}
-
-unsigned LayerPool::backingStoreBytesForSize(const IntSize& size)
-{
- return size.width() * size.height() * 4;
-}
-
-LayerPool::LayerList& LayerPool::listOfLayersWithSize(const IntSize& size, AccessType accessType)
-{
- HashMap<IntSize, LayerList>::iterator it = m_reuseLists.find(size);
- if (it == m_reuseLists.end()) {
- it = m_reuseLists.add(size, LayerList()).iterator;
- m_sizesInPruneOrder.append(size);
- } else if (accessType == MarkAsUsed) {
- m_sizesInPruneOrder.remove(m_sizesInPruneOrder.reverseFind(size));
- m_sizesInPruneOrder.append(size);
- }
- return it->value;
-}
-
-void LayerPool::addLayer(const RefPtr<PlatformCALayer>& layer)
-{
- IntSize layerSize(expandedIntSize(layer->bounds().size()));
- if (!canReuseLayerWithSize(layerSize))
- return;
-
- listOfLayersWithSize(layerSize).prepend(layer);
- m_totalBytes += backingStoreBytesForSize(layerSize);
-
- m_lastAddTime = monotonicallyIncreasingTime();
- schedulePrune();
-}
-
-RefPtr<PlatformCALayer> LayerPool::takeLayerWithSize(const IntSize& size)
-{
- if (!canReuseLayerWithSize(size))
- return nil;
- LayerList& reuseList = listOfLayersWithSize(size, MarkAsUsed);
- if (reuseList.isEmpty())
- return nil;
- m_totalBytes -= backingStoreBytesForSize(size);
- return reuseList.takeFirst();
-}
-
-unsigned LayerPool::decayedCapacity() const
-{
- // Decay to one quarter over capacityDecayTime
- double timeSinceLastAdd = monotonicallyIncreasingTime() - m_lastAddTime;
- if (timeSinceLastAdd > capacityDecayTime)
- return m_maxBytesForPool / 4;
- float decayProgess = float(timeSinceLastAdd / capacityDecayTime);
- return m_maxBytesForPool / 4 + m_maxBytesForPool * 3 / 4 * (1 - decayProgess);
-}
-
-void LayerPool::schedulePrune()
-{
- if (m_pruneTimer.isActive())
- return;
- m_pruneTimer.startOneShot(1);
-}
-
-void LayerPool::pruneTimerFired(Timer<LayerPool>&)
-{
- unsigned shrinkTo = decayedCapacity();
- while (m_totalBytes > shrinkTo) {
- ASSERT(!m_sizesInPruneOrder.isEmpty());
- IntSize sizeToDrop = m_sizesInPruneOrder.first();
- LayerList& oldestReuseList = m_reuseLists.find(sizeToDrop)->value;
- if (oldestReuseList.isEmpty()) {
- m_reuseLists.remove(sizeToDrop);
- m_sizesInPruneOrder.remove(0);
- continue;
- }
-
- m_totalBytes -= backingStoreBytesForSize(sizeToDrop);
- // The last element in the list is the oldest, hence most likely not to
- // still have a backing store.
- oldestReuseList.remove(--oldestReuseList.end());
- }
- if (monotonicallyIncreasingTime() - m_lastAddTime <= capacityDecayTime)
- schedulePrune();
-}
-
-void LayerPool::drain()
-{
- m_reuseLists.clear();
- m_sizesInPruneOrder.clear();
- m_totalBytes = 0;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacTileCoverageMaph"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.h (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.h        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.h        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011-2014 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. AND ITS CONTRIBUTORS ``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 ITS 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 TileCoverageMap_h
-#define TileCoverageMap_h
-
-#include "FloatRect.h"
-#include "IntRect.h"
-#include "PlatformCALayer.h"
-#include "PlatformCALayerClient.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/RetainPtr.h>
-
-namespace WebCore {
-
-class FloatRect;
-class IntPoint;
-class IntRect;
-class TileController;
-
-class TileCoverageMap : public PlatformCALayerClient {
- WTF_MAKE_NONCOPYABLE(TileCoverageMap); WTF_MAKE_FAST_ALLOCATED;
-public:
- TileCoverageMap(const TileController&);
- ~TileCoverageMap();
-
- void update();
- void setPosition(const FloatPoint& position) { m_position = position; }
-
- PlatformCALayer& layer() { return m_layer.get(); }
-
- void setDeviceScaleFactor(float);
-
-private:
- // PlatformCALayerClient
- virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesTopDown; }
- virtual bool platformCALayerContentsOpaque() const override { return true; }
- virtual bool platformCALayerDrawsContent() const override { return true; }
- virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) override;
- virtual float platformCALayerDeviceScaleFactor() const override;
-
- const TileController& m_controller;
-
- Ref<PlatformCALayer> m_layer;
- Ref<PlatformCALayer> m_visibleRectIndicatorLayer;
-
- FloatPoint m_position;
-};
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacTileCoverageMapmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.mm (169947 => 169948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.mm        2014-06-13 20:43:32 UTC (rev 169947)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCoverageMap.mm        2014-06-13 21:13:43 UTC (rev 169948)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011-2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
- */
-
-#import "config.h"
-#import "TileCoverageMap.h"
-
-#import "GraphicsContext.h"
-#import "TileController.h"
-#import "TileGrid.h"
-
-namespace WebCore {
-
-TileCoverageMap::TileCoverageMap(const TileController& controller)
- : m_controller(controller)
- , m_layer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this))
- , m_visibleRectIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
- , m_position(FloatPoint(0, controller.topContentInset()))
-{
- m_layer.get().setOpacity(0.75);
- m_layer.get().setAnchorPoint(FloatPoint3D());
- m_layer.get().setBorderColor(Color::black);
- m_layer.get().setBorderWidth(1);
- m_layer.get().setPosition(FloatPoint(2, 2));
- m_layer.get().setContentsScale(m_controller.deviceScaleFactor());
- m_visibleRectIndicatorLayer.get().setBorderWidth(2);
- m_visibleRectIndicatorLayer.get().setAnchorPoint(FloatPoint3D());
- m_visibleRectIndicatorLayer.get().setBorderColor(Color(255, 0, 0));
-
- m_layer.get().appendSublayer(&m_visibleRectIndicatorLayer.get());
-
- update();
-}
-
-TileCoverageMap::~TileCoverageMap()
-{
- m_layer.get().setOwner(nullptr);
-}
-
-void TileCoverageMap::update()
-{
- FloatRect containerBounds = m_controller.bounds();
- FloatRect visibleRect = m_controller.visibleRect();
- visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges.
- visibleRect.setHeight(visibleRect.height() - m_controller.topContentInset());
-
- float widthScale = 1;
- float scale = 1;
- if (!containerBounds.isEmpty()) {
- widthScale = std::min<float>(visibleRect.width() / containerBounds.width(), 0.1);
- scale = std::min(widthScale, visibleRect.height() / containerBounds.height());
- }
-
- float indicatorScale = scale * m_controller.tileGrid().scale();
- FloatRect mapBounds = containerBounds;
- mapBounds.scale(indicatorScale, indicatorScale);
-
- m_layer.get().setPosition(m_position + FloatPoint(2, 2));
- m_layer.get().setBounds(mapBounds);
- m_layer.get().setNeedsDisplay();
-
- visibleRect.scale(indicatorScale, indicatorScale);
- visibleRect.expand(2, 2);
- m_visibleRectIndicatorLayer->setPosition(visibleRect.location());
- m_visibleRectIndicatorLayer->setBounds(FloatRect(FloatPoint(), visibleRect.size()));
-
- Color visibleRectIndicatorColor;
- switch (m_controller.indicatorMode()) {
- case SynchronousScrollingBecauseOfStyleIndication:
- visibleRectIndicatorColor = Color(255, 0, 0);
- break;
- case SynchronousScrollingBecauseOfEventHandlersIndication:
- visibleRectIndicatorColor = Color(255, 255, 0);
- break;
- case AsyncScrollingIndication:
- visibleRectIndicatorColor = Color(0, 200, 0);
- break;
- }
-
- m_visibleRectIndicatorLayer.get().setBorderColor(visibleRectIndicatorColor);
-}
-
-void TileCoverageMap::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&)
-{
- ASSERT_UNUSED(platformCALayer, platformCALayer == &m_layer.get());
- m_controller.tileGrid().drawTileMapContents(context.platformContext(), m_layer.get().bounds());
-}
-
-float TileCoverageMap::platformCALayerDeviceScaleFactor() const
-{
- return m_controller.rootLayer().owner()->platformCALayerDeviceScaleFactor();
-}
-
-void TileCoverageMap::setDeviceScaleFactor(float deviceScaleFactor)
-{
- m_layer.get().setContentsScale(deviceScaleFactor);
-}
-
-}
</del></span></pre>
</div>
</div>
</body>
</html>