Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 computeQuads(*m_node, quads); 257 computeQuads(*m_node, quads);
258 DCHECK(quads.size()); 258 DCHECK(quads.size());
259 Path newPath; 259 Path newPath;
260 260
261 for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) { 261 for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) {
262 FloatQuad absoluteQuad = quads[quadIndex]; 262 FloatQuad absoluteQuad = quads[quadIndex];
263 263
264 // Scrolling content layers have the same offset from layout object as the 264 // Scrolling content layers have the same offset from layout object as the
265 // non-scrolling layers. Thus we need to adjust for their scroll offset. 265 // non-scrolling layers. Thus we need to adjust for their scroll offset.
266 if (m_isScrollingGraphicsLayer) { 266 if (m_isScrollingGraphicsLayer) {
267 DoubleSize adjustedScrollOffset = paintInvalidationContainer.layer() 267 FloatPoint scrollPosition = paintInvalidationContainer.layer()
268 ->getScrollableArea() 268 ->getScrollableArea()
269 ->adjustedScrollOffset(); 269 ->scrollPosition();
270 absoluteQuad.move(adjustedScrollOffset.width(), 270 absoluteQuad.move(toScrollOffset(scrollPosition));
271 adjustedScrollOffset.height());
272 } 271 }
273 272
274 // Transform node quads in target absolute coords to local coordinates in 273 // Transform node quads in target absolute coords to local coordinates in
275 // the compositor layer. 274 // the compositor layer.
276 FloatQuad transformedQuad; 275 FloatQuad transformedQuad;
277 convertTargetSpaceQuadToCompositedLayer( 276 convertTargetSpaceQuadToCompositedLayer(
278 absoluteQuad, m_node->layoutObject(), paintInvalidationContainer, 277 absoluteQuad, m_node->layoutObject(), paintInvalidationContainer,
279 transformedQuad); 278 transformedQuad);
280 279
281 // FIXME: for now, we'll only use rounded paths if we have a single node 280 // FIXME: for now, we'll only use rounded paths if we have a single node
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 443
445 WebLayer* LinkHighlightImpl::layer() { 444 WebLayer* LinkHighlightImpl::layer() {
446 return clipLayer(); 445 return clipLayer();
447 } 446 }
448 447
449 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { 448 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const {
450 return m_compositorPlayer.get(); 449 return m_compositorPlayer.get();
451 } 450 }
452 451
453 } // namespace blink 452 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/FindInPageCoordinates.cpp ('k') | third_party/WebKit/Source/web/ResizeViewportAnchor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698