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

Side by Side Diff: Source/platform/geometry/LayoutRect.h

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comments from tdresser Created 5 years, 6 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 inline IntRect pixelSnappedIntRect(const LayoutRect& rect) 229 inline IntRect pixelSnappedIntRect(const LayoutRect& rect)
230 { 230 {
231 return IntRect(roundedIntPoint(rect.location()), IntSize( 231 return IntRect(roundedIntPoint(rect.location()), IntSize(
232 snapSizeToPixel(rect.width(), rect.x()), 232 snapSizeToPixel(rect.width(), rect.x()),
233 snapSizeToPixel(rect.height(), rect.y()))); 233 snapSizeToPixel(rect.height(), rect.y())));
234 } 234 }
235 235
236 PLATFORM_EXPORT IntRect enclosingIntRect(const LayoutRect&); 236 PLATFORM_EXPORT IntRect enclosingIntRect(const LayoutRect&);
237 PLATFORM_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&); 237 PLATFORM_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&);
238 238
239 // Returns a layout rect with minimum size for width and height that contains
240 // |point|.
241 PLATFORM_EXPORT LayoutRect boundingRect(const LayoutPoint&);
242
239 inline IntRect pixelSnappedIntRect(LayoutUnit left, LayoutUnit top, LayoutUnit w idth, LayoutUnit height) 243 inline IntRect pixelSnappedIntRect(LayoutUnit left, LayoutUnit top, LayoutUnit w idth, LayoutUnit height)
240 { 244 {
241 return IntRect(left.round(), top.round(), snapSizeToPixel(width, left), snap SizeToPixel(height, top)); 245 return IntRect(left.round(), top.round(), snapSizeToPixel(width, left), snap SizeToPixel(height, top));
242 } 246 }
243 247
244 inline IntRect pixelSnappedIntRectFromEdges(LayoutUnit left, LayoutUnit top, Lay outUnit right, LayoutUnit bottom) 248 inline IntRect pixelSnappedIntRectFromEdges(LayoutUnit left, LayoutUnit top, Lay outUnit right, LayoutUnit bottom)
245 { 249 {
246 return IntRect(left.round(), top.round(), snapSizeToPixel(right - left, left ), snapSizeToPixel(bottom - top, top)); 250 return IntRect(left.round(), top.round(), snapSizeToPixel(right - left, left ), snapSizeToPixel(bottom - top, top));
247 } 251 }
248 252
249 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) 253 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size)
250 { 254 {
251 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location )); 255 return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location ));
252 } 256 }
253 257
254 } // namespace blink 258 } // namespace blink
255 259
256 #endif // LayoutRect_h 260 #endif // LayoutRect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698