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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // of the paint invalidation container not being composited. | 199 // of the paint invalidation container not being composited. |
200 if (!paintInvalidationContainer->layer()->compositedDeprecatedPaintLayerMapp
ing() && !paintInvalidationContainer->layer()->groupedMapping()) | 200 if (!paintInvalidationContainer->layer()->compositedDeprecatedPaintLayerMapp
ing() && !paintInvalidationContainer->layer()->groupedMapping()) |
201 return false; | 201 return false; |
202 | 202 |
203 // Get quads for node in absolute coordinates. | 203 // Get quads for node in absolute coordinates. |
204 Vector<FloatQuad> quads; | 204 Vector<FloatQuad> quads; |
205 computeQuads(*m_node, quads); | 205 computeQuads(*m_node, quads); |
206 ASSERT(quads.size()); | 206 ASSERT(quads.size()); |
207 Path newPath; | 207 Path newPath; |
208 | 208 |
209 FloatPoint positionAdjustForCompositedScrolling = IntPoint(m_currentGraphics
Layer->offsetFromLayoutObject()); | |
210 | |
211 for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) { | 209 for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) { |
212 FloatQuad absoluteQuad = quads[quadIndex]; | 210 FloatQuad absoluteQuad = quads[quadIndex]; |
213 | 211 |
214 // FIXME: this hack should not be necessary. It's a consequence of the f
act that composited layers for scrolling are represented | |
215 // differently in Blink than other composited layers. | |
216 if (paintInvalidationContainer->layer()->needsCompositedScrolling() && m
_node->layoutObject() != paintInvalidationContainer) | |
217 absoluteQuad.move(-positionAdjustForCompositedScrolling.x(), -positi
onAdjustForCompositedScrolling.y()); | |
218 | |
219 // Transform node quads in target absolute coords to local coordinates i
n the compositor layer. | 212 // Transform node quads in target absolute coords to local coordinates i
n the compositor layer. |
220 FloatQuad transformedQuad; | 213 FloatQuad transformedQuad; |
221 convertTargetSpaceQuadToCompositedLayer(absoluteQuad, m_node->layoutObje
ct(), paintInvalidationContainer, transformedQuad); | 214 convertTargetSpaceQuadToCompositedLayer(absoluteQuad, m_node->layoutObje
ct(), paintInvalidationContainer, transformedQuad); |
222 | 215 |
223 // FIXME: for now, we'll only use rounded paths if we have a single node
quad. The reason for this is that | 216 // FIXME: for now, we'll only use rounded paths if we have a single node
quad. The reason for this is that |
224 // we may sometimes get a chain of adjacent boxes (e.g. for text nodes)
which end up looking like sausage | 217 // we may sometimes get a chain of adjacent boxes (e.g. for text nodes)
which end up looking like sausage |
225 // links: these should ideally be merged into a single rect before creat
ing the path, but that's | 218 // links: these should ideally be merged into a single rect before creat
ing the path, but that's |
226 // another CL. | 219 // another CL. |
227 if (quads.size() == 1 && transformedQuad.isRectilinear() | 220 if (quads.size() == 1 && transformedQuad.isRectilinear() |
228 && !m_owningWebViewImpl->settingsImpl()->mockGestureTapHighlightsEna
bled()) { | 221 && !m_owningWebViewImpl->settingsImpl()->mockGestureTapHighlightsEna
bled()) { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). | 354 // Make sure we update geometry on the next callback from WebViewImpl::layou
t(). |
362 m_geometryNeedsUpdate = true; | 355 m_geometryNeedsUpdate = true; |
363 } | 356 } |
364 | 357 |
365 WebLayer* LinkHighlight::layer() | 358 WebLayer* LinkHighlight::layer() |
366 { | 359 { |
367 return clipLayer(); | 360 return clipLayer(); |
368 } | 361 } |
369 | 362 |
370 } // namespace blink | 363 } // namespace blink |
OLD | NEW |