| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 | 323 |
| 324 void LinkHighlightImpl::notifyAnimationFinished(double, int) | 324 void LinkHighlightImpl::notifyAnimationFinished(double, int) |
| 325 { | 325 { |
| 326 // Since WebViewImpl may hang on to us for a while, make sure we | 326 // Since WebViewImpl may hang on to us for a while, make sure we |
| 327 // release resources as soon as possible. | 327 // release resources as soon as possible. |
| 328 clearGraphicsLayerLinkHighlightPointer(); | 328 clearGraphicsLayerLinkHighlightPointer(); |
| 329 releaseResources(); | 329 releaseResources(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 class LinkHighlightDisplayItemClientForTracking : public DisplayItemClient { |
| 333 String debugName() const final { return "LinkHighlight"; } |
| 334 LayoutRect visualRect() const final { return LayoutRect(); } |
| 335 }; |
| 336 |
| 332 void LinkHighlightImpl::updateGeometry() | 337 void LinkHighlightImpl::updateGeometry() |
| 333 { | 338 { |
| 334 // To avoid unnecessary updates (e.g. other entities have requested animatio
ns from our WebViewImpl), | 339 // To avoid unnecessary updates (e.g. other entities have requested animatio
ns from our WebViewImpl), |
| 335 // only proceed if we actually requested an update. | 340 // only proceed if we actually requested an update. |
| 336 if (!m_geometryNeedsUpdate) | 341 if (!m_geometryNeedsUpdate) |
| 337 return; | 342 return; |
| 338 | 343 |
| 339 m_geometryNeedsUpdate = false; | 344 m_geometryNeedsUpdate = false; |
| 340 | 345 |
| 341 bool hasLayoutObject = m_node && m_node->layoutObject(); | 346 bool hasLayoutObject = m_node && m_node->layoutObject(); |
| 342 if (hasLayoutObject) { | 347 if (hasLayoutObject) { |
| 343 const LayoutBoxModelObject& paintInvalidationContainer = m_node->layoutO
bject()->containerForPaintInvalidation(); | 348 const LayoutBoxModelObject& paintInvalidationContainer = m_node->layoutO
bject()->containerForPaintInvalidation(); |
| 344 attachLinkHighlightToCompositingLayer(paintInvalidationContainer); | 349 attachLinkHighlightToCompositingLayer(paintInvalidationContainer); |
| 345 if (computeHighlightLayerPathAndPosition(paintInvalidationContainer)) { | 350 if (computeHighlightLayerPathAndPosition(paintInvalidationContainer)) { |
| 346 // We only need to invalidate the layer if the highlight size has ch
anged, otherwise | 351 // We only need to invalidate the layer if the highlight size has ch
anged, otherwise |
| 347 // we can just re-position the layer without needing to repaint. | 352 // we can just re-position the layer without needing to repaint. |
| 348 m_contentLayer->layer()->invalidate(); | 353 m_contentLayer->layer()->invalidate(); |
| 349 | 354 |
| 350 if (m_currentGraphicsLayer && m_currentGraphicsLayer->isTrackingPain
tInvalidations()) | 355 if (m_currentGraphicsLayer && m_currentGraphicsLayer->isTrackingPain
tInvalidations()) |
| 351 m_currentGraphicsLayer->trackPaintInvalidationRect(FloatRect(lay
er()->position().x, layer()->position().y, layer()->bounds().width, layer()->bou
nds().height)); | 356 m_currentGraphicsLayer->trackPaintInvalidation(LinkHighlightDisp
layItemClientForTracking(), FloatRect(layer()->position().x, layer()->position()
.y, layer()->bounds().width, layer()->bounds().height), PaintInvalidationFull); |
| 352 } | 357 } |
| 353 } else { | 358 } else { |
| 354 clearGraphicsLayerLinkHighlightPointer(); | 359 clearGraphicsLayerLinkHighlightPointer(); |
| 355 releaseResources(); | 360 releaseResources(); |
| 356 } | 361 } |
| 357 } | 362 } |
| 358 | 363 |
| 359 void LinkHighlightImpl::clearCurrentGraphicsLayer() | 364 void LinkHighlightImpl::clearCurrentGraphicsLayer() |
| 360 { | 365 { |
| 361 m_currentGraphicsLayer = 0; | 366 m_currentGraphicsLayer = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 372 { | 377 { |
| 373 return clipLayer(); | 378 return clipLayer(); |
| 374 } | 379 } |
| 375 | 380 |
| 376 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const | 381 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const |
| 377 { | 382 { |
| 378 return m_compositorPlayer.get(); | 383 return m_compositorPlayer.get(); |
| 379 } | 384 } |
| 380 | 385 |
| 381 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |