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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 m_geometryNeedsUpdate = false; | 328 m_geometryNeedsUpdate = false; |
329 | 329 |
330 RenderLayer* compositingLayer = computeEnclosingCompositingLayer(); | 330 RenderLayer* compositingLayer = computeEnclosingCompositingLayer(); |
331 if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLaye
r)) { | 331 if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLaye
r)) { |
332 // We only need to invalidate the layer if the highlight size has change
d, otherwise | 332 // We only need to invalidate the layer if the highlight size has change
d, otherwise |
333 // we can just re-position the layer without needing to repaint. | 333 // we can just re-position the layer without needing to repaint. |
334 m_contentLayer->layer()->invalidate(); | 334 m_contentLayer->layer()->invalidate(); |
335 | 335 |
336 if (m_currentGraphicsLayer) | 336 if (m_currentGraphicsLayer) |
337 m_currentGraphicsLayer->addRepaintRect(FloatRect(layer()->position()
.x, layer()->position().y, layer()->bounds().width, layer()->bounds().height)); | 337 m_currentGraphicsLayer->addRepaintRect(FloatRect(layer()->position()
.x, layer()->position().y, layer()->bounds().width, layer()->bounds().height)); |
338 } else { | |
339 clearGraphicsLayerLinkHighlightPointer(); | |
340 releaseResources(); | |
341 } | 338 } |
342 } | 339 } |
343 | 340 |
344 void LinkHighlight::clearCurrentGraphicsLayer() | 341 void LinkHighlight::clearCurrentGraphicsLayer() |
345 { | 342 { |
346 m_currentGraphicsLayer = 0; | 343 m_currentGraphicsLayer = 0; |
347 m_geometryNeedsUpdate = true; | 344 m_geometryNeedsUpdate = true; |
348 } | 345 } |
349 | 346 |
350 void LinkHighlight::invalidate() | 347 void LinkHighlight::invalidate() |
351 { | 348 { |
352 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). | 349 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). |
353 m_geometryNeedsUpdate = true; | 350 m_geometryNeedsUpdate = true; |
354 } | 351 } |
355 | 352 |
356 WebLayer* LinkHighlight::layer() | 353 WebLayer* LinkHighlight::layer() |
357 { | 354 { |
358 return clipLayer(); | 355 return clipLayer(); |
359 } | 356 } |
360 | 357 |
361 } // namespace WeKit | 358 } // namespace WeKit |
OLD | NEW |