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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 RenderLayer* LinkHighlight::computeEnclosingCompositingLayer() | 108 RenderLayer* LinkHighlight::computeEnclosingCompositingLayer() |
109 { | 109 { |
110 if (!m_node || !m_node->renderer()) | 110 if (!m_node || !m_node->renderer()) |
111 return 0; | 111 return 0; |
112 | 112 |
113 // Find the nearest enclosing composited layer and attach to it. We may need
to cross frame boundaries | 113 // Find the nearest enclosing composited layer and attach to it. We may need
to cross frame boundaries |
114 // to find a suitable layer. | 114 // to find a suitable layer. |
115 RenderObject* renderer = m_node->renderer(); | 115 RenderObject* renderer = m_node->renderer(); |
116 RenderLayerModelObject* repaintContainer; | 116 RenderLayer* renderLayer; |
117 do { | 117 do { |
118 repaintContainer = renderer->containerForRepaint(); | 118 renderLayer = renderer->enclosingLayer()->enclosingCompositingLayerForRe
paint(); |
119 // FIXME: Repaint container should never be null. crbug.com/363699 | 119 if (!renderLayer) { |
120 if (!repaintContainer) { | |
121 renderer = renderer->frame()->ownerRenderer(); | 120 renderer = renderer->frame()->ownerRenderer(); |
122 if (!renderer) | 121 if (!renderer) |
123 return 0; | 122 return 0; |
124 } | 123 } |
125 } while (!repaintContainer); | 124 } while (!renderLayer); |
126 RenderLayer* renderLayer = repaintContainer->layer(); | |
127 | |
128 if (!renderLayer || renderLayer->compositingState() == NotComposited) | |
129 return 0; | |
130 | 125 |
131 CompositedLayerMappingPtr compositedLayerMapping = renderLayer->compositingS
tate() == PaintsIntoGroupedBacking ? renderLayer->groupedMapping() : renderLayer
->compositedLayerMapping(); | 126 CompositedLayerMappingPtr compositedLayerMapping = renderLayer->compositingS
tate() == PaintsIntoGroupedBacking ? renderLayer->groupedMapping() : renderLayer
->compositedLayerMapping(); |
132 GraphicsLayer* newGraphicsLayer = renderLayer->compositingState() == PaintsI
ntoGroupedBacking ? compositedLayerMapping->squashingLayer() : compositedLayerMa
pping->mainGraphicsLayer(); | 127 GraphicsLayer* newGraphicsLayer = renderLayer->compositingState() == PaintsI
ntoGroupedBacking ? compositedLayerMapping->squashingLayer() : compositedLayerMa
pping->mainGraphicsLayer(); |
133 | 128 |
134 m_clipLayer->setTransform(SkMatrix44()); | 129 m_clipLayer->setTransform(SkMatrix44()); |
135 | 130 |
136 if (!newGraphicsLayer->drawsContent()) { | 131 if (!newGraphicsLayer->drawsContent()) { |
137 if (renderLayer->scrollableArea() && renderLayer->scrollableArea()->uses
CompositedScrolling()) { | 132 if (renderLayer->scrollableArea() && renderLayer->scrollableArea()->uses
CompositedScrolling()) { |
138 ASSERT(renderLayer->hasCompositedLayerMapping() && renderLayer->comp
ositedLayerMapping()->scrollingContentsLayer()); | 133 ASSERT(renderLayer->hasCompositedLayerMapping() && renderLayer->comp
ositedLayerMapping()->scrollingContentsLayer()); |
139 newGraphicsLayer = compositedLayerMapping->scrollingContentsLayer(); | 134 newGraphicsLayer = compositedLayerMapping->scrollingContentsLayer(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). | 353 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). |
359 m_geometryNeedsUpdate = true; | 354 m_geometryNeedsUpdate = true; |
360 } | 355 } |
361 | 356 |
362 WebLayer* LinkHighlight::layer() | 357 WebLayer* LinkHighlight::layer() |
363 { | 358 { |
364 return clipLayer(); | 359 return clipLayer(); |
365 } | 360 } |
366 | 361 |
367 } // namespace WeKit | 362 } // namespace WeKit |
OLD | NEW |