Changeset 98667 in webkit
- Timestamp:
- Oct 27, 2011 5:37:02 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98664 r98667 1 2011-10-27 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Track when CCLayerImpl properties have changed. 4 https://bugs.webkit.org/show_bug.cgi?id=70442 5 6 Reviewed by James Robinson. 7 8 To determine a good scissor rect, we must determine what 9 will change on the screen on the next redraw. This patch 10 tracks the necessary information on CCLayerImpl and marks 11 a flag indicating whether this layer will "damage" the screen. 12 The other portion of "change", the updateRect, was already 13 landed in https://bugs.webkit.org/show_bug.cgi?id=69441. 14 15 New unit test added to CCLayerImplTest to test this patch. 16 17 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 18 (WebCore::CCLayerImpl::CCLayerImpl): 19 (WebCore::CCLayerImpl::scrollBy): 20 (WebCore::CCLayerImpl::noteLayerPropertyChangedForSubtree): 21 (WebCore::CCLayerImpl::noteLayerPropertyChangedForDescendants): 22 (WebCore::CCLayerImpl::setBounds): 23 (WebCore::CCLayerImpl::setMaskLayer): 24 (WebCore::CCLayerImpl::setReplicaLayer): 25 (WebCore::CCLayerImpl::setDrawsContent): 26 (WebCore::CCLayerImpl::setAnchorPoint): 27 (WebCore::CCLayerImpl::setAnchorPointZ): 28 (WebCore::CCLayerImpl::setMasksToBounds): 29 (WebCore::CCLayerImpl::setOpaque): 30 (WebCore::CCLayerImpl::setOpacity): 31 (WebCore::CCLayerImpl::setPosition): 32 (WebCore::CCLayerImpl::setPreserves3D): 33 (WebCore::CCLayerImpl::setSublayerTransform): 34 (WebCore::CCLayerImpl::setTransform): 35 (WebCore::CCLayerImpl::setDebugBorderColor): 36 (WebCore::CCLayerImpl::setDebugBorderWidth): 37 (WebCore::CCLayerImpl::setContentBounds): 38 (WebCore::CCLayerImpl::setScrollPosition): 39 (WebCore::CCLayerImpl::setScrollDelta): 40 (WebCore::CCLayerImpl::setDoubleSided): 41 * platform/graphics/chromium/cc/CCLayerImpl.h: 42 (WebCore::CCLayerImpl::layerPropertyChanged): 43 (WebCore::CCLayerImpl::resetLayerPropertyChanged): 44 1 45 2011-10-27 Anders Carlsson <andersca@apple.com> 2 46 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r98567 r98667 44 44 , m_anchorPointZ(0) 45 45 , m_doubleSided(true) 46 , m_layerPropertyChanged(false) 46 47 , m_masksToBounds(false) 47 48 , m_opaque(false) … … 127 128 // Clamp newDelta so that position + delta stays within scroll bounds. 128 129 m_scrollDelta = newDelta.expandedTo(minDelta).shrunkTo(maxDelta); 130 noteLayerPropertyChangedForSubtree(); 129 131 } 130 132 … … 224 226 } 225 227 228 void CCLayerImpl::noteLayerPropertyChangedForSubtree() 229 { 230 m_layerPropertyChanged = true; 231 noteLayerPropertyChangedForDescendants(); 232 } 233 234 void CCLayerImpl::noteLayerPropertyChangedForDescendants() 235 { 236 for (size_t i = 0; i < m_children.size(); ++i) 237 m_children[i]->noteLayerPropertyChangedForSubtree(); 238 } 239 240 void CCLayerImpl::setBounds(const IntSize& bounds) 241 { 242 if (m_bounds != bounds) { 243 m_bounds = bounds; 244 245 if (masksToBounds()) 246 noteLayerPropertyChangedForSubtree(); 247 else 248 m_layerPropertyChanged = true; 249 } 250 } 251 252 void CCLayerImpl::setMaskLayer(PassRefPtr<CCLayerImpl> maskLayer) 253 { 254 if (m_maskLayer != maskLayer) { 255 m_maskLayer = maskLayer; 256 noteLayerPropertyChangedForSubtree(); 257 } 258 } 259 260 void CCLayerImpl::setReplicaLayer(PassRefPtr<CCLayerImpl> replicaLayer) 261 { 262 if (m_replicaLayer != replicaLayer) { 263 m_replicaLayer = replicaLayer; 264 noteLayerPropertyChangedForSubtree(); 265 } 266 } 267 268 void CCLayerImpl::setDrawsContent(bool drawsContent) 269 { 270 if (m_drawsContent != drawsContent) { 271 m_drawsContent = drawsContent; 272 m_layerPropertyChanged = true; 273 } 274 } 275 276 void CCLayerImpl::setAnchorPoint(const FloatPoint& anchorPoint) 277 { 278 if (m_anchorPoint != anchorPoint) { 279 m_anchorPoint = anchorPoint; 280 noteLayerPropertyChangedForSubtree(); 281 } 282 } 283 284 void CCLayerImpl::setAnchorPointZ(float anchorPointZ) 285 { 286 if (m_anchorPointZ != anchorPointZ) { 287 m_anchorPointZ = anchorPointZ; 288 noteLayerPropertyChangedForSubtree(); 289 } 290 } 291 292 void CCLayerImpl::setMasksToBounds(bool masksToBounds) 293 { 294 if (m_masksToBounds != masksToBounds) { 295 m_masksToBounds = masksToBounds; 296 noteLayerPropertyChangedForSubtree(); 297 } 298 } 299 300 void CCLayerImpl::setOpaque(bool opaque) 301 { 302 if (m_opaque != opaque) { 303 m_opaque = opaque; 304 noteLayerPropertyChangedForSubtree(); 305 } 306 } 307 308 void CCLayerImpl::setOpacity(float opacity) 309 { 310 if (m_opacity != opacity) { 311 m_opacity = opacity; 312 noteLayerPropertyChangedForSubtree(); 313 } 314 } 315 316 void CCLayerImpl::setPosition(const FloatPoint& position) 317 { 318 if (m_position != position) { 319 m_position = position; 320 noteLayerPropertyChangedForSubtree(); 321 } 322 } 323 324 void CCLayerImpl::setPreserves3D(bool preserves3D) 325 { 326 if (m_preserves3D != preserves3D) { 327 m_preserves3D = preserves3D; 328 noteLayerPropertyChangedForSubtree(); 329 } 330 } 331 332 void CCLayerImpl::setSublayerTransform(const TransformationMatrix& sublayerTransform) 333 { 334 if (m_sublayerTransform != sublayerTransform) { 335 m_sublayerTransform = sublayerTransform; 336 // sublayer transform does not affect the current layer; it affects only its children. 337 noteLayerPropertyChangedForDescendants(); 338 } 339 } 340 341 void CCLayerImpl::setTransform(const TransformationMatrix& transform) 342 { 343 if (m_transform != transform) { 344 m_transform = transform; 345 noteLayerPropertyChangedForSubtree(); 346 } 347 } 348 349 void CCLayerImpl::setDebugBorderColor(Color debugBorderColor) 350 { 351 if (m_debugBorderColor != debugBorderColor) { 352 m_debugBorderColor = debugBorderColor; 353 m_layerPropertyChanged = true; 354 } 355 } 356 357 void CCLayerImpl::setDebugBorderWidth(float debugBorderWidth) 358 { 359 if (m_debugBorderWidth != debugBorderWidth) { 360 m_debugBorderWidth = debugBorderWidth; 361 m_layerPropertyChanged = true; 362 } 363 } 364 365 void CCLayerImpl::setContentBounds(const IntSize& contentBounds) 366 { 367 if (m_contentBounds != contentBounds) { 368 m_contentBounds = contentBounds; 369 m_layerPropertyChanged = true; 370 } 371 } 372 373 void CCLayerImpl::setScrollPosition(const IntPoint& scrollPosition) 374 { 375 if (m_scrollPosition != scrollPosition) { 376 m_scrollPosition = scrollPosition; 377 noteLayerPropertyChangedForSubtree(); 378 } 379 } 380 381 void CCLayerImpl::setScrollDelta(const IntSize& scrollDelta) 382 { 383 if (m_scrollDelta != scrollDelta) { 384 m_scrollDelta = scrollDelta; 385 noteLayerPropertyChangedForSubtree(); 386 } 387 } 388 389 void CCLayerImpl::setDoubleSided(bool doubleSided) 390 { 391 if (m_doubleSided != doubleSided) { 392 m_doubleSided = doubleSided; 393 noteLayerPropertyChangedForSubtree(); 394 } 395 } 396 226 397 } 227 398 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r98567 r98667 59 59 void removeAllChildren(); 60 60 61 void setMaskLayer(PassRefPtr<CCLayerImpl> maskLayer) { m_maskLayer = maskLayer; }61 void setMaskLayer(PassRefPtr<CCLayerImpl>); 62 62 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } 63 63 64 void setReplicaLayer(PassRefPtr<CCLayerImpl> replicaLayer) { m_replicaLayer = replicaLayer; }64 void setReplicaLayer(PassRefPtr<CCLayerImpl>); 65 65 CCLayerImpl* replicaLayer() const { return m_replicaLayer.get(); } 66 66 … … 76 76 77 77 // Returns true if this layer has content to draw. 78 void setDrawsContent(bool drawsContent) { m_drawsContent = drawsContent; }78 void setDrawsContent(bool); 79 79 bool drawsContent() const { return m_drawsContent; } 80 80 … … 84 84 void cleanupResources(); 85 85 86 void setAnchorPoint(const FloatPoint& anchorPoint) { m_anchorPoint = anchorPoint; }86 void setAnchorPoint(const FloatPoint&); 87 87 const FloatPoint& anchorPoint() const { return m_anchorPoint; } 88 88 89 void setAnchorPointZ(float anchorPointZ) { m_anchorPointZ = anchorPointZ; }89 void setAnchorPointZ(float); 90 90 float anchorPointZ() const { return m_anchorPointZ; } 91 91 92 void setMasksToBounds(bool masksToBounds) { m_masksToBounds = masksToBounds; }92 void setMasksToBounds(bool); 93 93 bool masksToBounds() const { return m_masksToBounds; } 94 94 95 void setOpaque(bool opaque) { m_opaque = opaque; }95 void setOpaque(bool); 96 96 bool opaque() const { return m_opaque; } 97 97 98 void setOpacity(float opacity) { m_opacity = opacity; }98 void setOpacity(float); 99 99 float opacity() const { return m_opacity; } 100 100 101 void setPosition(const FloatPoint& position) { m_position = position; }101 void setPosition(const FloatPoint&); 102 102 const FloatPoint& position() const { return m_position; } 103 103 104 void setPreserves3D(bool preserves3D) { m_preserves3D = preserves3D; }104 void setPreserves3D(bool); 105 105 bool preserves3D() const { return m_preserves3D; } 106 106 … … 111 111 bool isNonCompositedContent() const { return m_isNonCompositedContent; } 112 112 113 void setSublayerTransform(const TransformationMatrix& sublayerTransform) { m_sublayerTransform = sublayerTransform; }113 void setSublayerTransform(const TransformationMatrix&); 114 114 const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; } 115 115 116 void setTransform(const TransformationMatrix& transform) { m_transform = transform; }116 void setTransform(const TransformationMatrix&); 117 117 const TransformationMatrix& transform() const { return m_transform; } 118 118 … … 121 121 122 122 // Debug layer border - visual effect only, do not change geometry/clipping/etc. 123 void setDebugBorderColor(Color c) { m_debugBorderColor = c; }123 void setDebugBorderColor(Color); 124 124 Color debugBorderColor() const { return m_debugBorderColor; } 125 void setDebugBorderWidth(float width) { m_debugBorderWidth = width; }125 void setDebugBorderWidth(float); 126 126 float debugBorderWidth() const { return m_debugBorderWidth; } 127 127 … … 141 141 142 142 const IntSize& bounds() const { return m_bounds; } 143 void setBounds(const IntSize& bounds) { m_bounds = bounds; }143 void setBounds(const IntSize&); 144 144 145 145 const IntSize& contentBounds() const { return m_contentBounds; } 146 void setContentBounds(const IntSize& contentBounds) { m_contentBounds = contentBounds; }146 void setContentBounds(const IntSize&); 147 147 148 148 const IntPoint& scrollPosition() const { return m_scrollPosition; } 149 void setScrollPosition(const IntPoint& scrollPosition) { m_scrollPosition = scrollPosition; }149 void setScrollPosition(const IntPoint&); 150 150 151 151 const IntSize& maxScrollPosition() const {return m_maxScrollPosition; } … … 153 153 154 154 const IntSize& scrollDelta() const { return m_scrollDelta; } 155 void setScrollDelta(const IntSize& scrollDelta) { m_scrollDelta = scrollDelta; }155 void setScrollDelta(const IntSize&); 156 156 157 157 void scrollBy(const IntSize& scroll); … … 162 162 163 163 bool doubleSided() const { return m_doubleSided; } 164 void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; }164 void setDoubleSided(bool); 165 165 166 166 // Returns the rect containtaining this layer in the current view's coordinate system. … … 178 178 String layerTreeAsText() const; 179 179 180 bool layerPropertyChanged() const { return m_layerPropertyChanged; } 181 void resetLayerPropertyChanged() { m_layerPropertyChanged = false; } 182 180 183 protected: 181 184 explicit CCLayerImpl(int); … … 188 191 friend class TreeSynchronizer; 189 192 void clearChildList(); // Warning: This does not preserve tree structure invariants and so is only exposed to the tree synchronizer. 193 194 void noteLayerPropertyChangedForSubtree(); 195 196 // Note carefully this does not affect the current layer. 197 void noteLayerPropertyChangedForDescendants(); 190 198 191 199 virtual const char* layerTypeAsString() const { return "LayerChromium"; } … … 210 218 // Whether the "back" of this layer should draw. 211 219 bool m_doubleSided; 220 221 // Tracks if drawing-related properties have changed since last redraw. 222 bool m_layerPropertyChanged; 212 223 213 224 IntRect m_visibleLayerRect; -
trunk/Source/WebKit/chromium/ChangeLog
r98651 r98667 1 2011-10-27 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Track when CCLayerImpl properties have changed. 4 https://bugs.webkit.org/show_bug.cgi?id=70442 5 6 Reviewed by James Robinson. 7 8 * WebKit.gypi: 9 * tests/CCLayerImplTest.cpp: Added. 10 (WebCore::TEST): 11 1 12 2011-10-27 Vsevolod Vlasov <vsevik@chromium.org> 2 13 -
trunk/Source/WebKit/chromium/WebKit.gypi
r98630 r98667 55 55 'tests/ArenaTestHelpers.h', 56 56 'tests/AssociatedURLLoaderTest.cpp', 57 'tests/CCLayerImplTest.cpp', 57 58 'tests/CCLayerSorterTest.cpp', 58 59 'tests/CCLayerTreeHostCommonTest.cpp',
Note: See TracChangeset
for help on using the changeset viewer.