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

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 17471008: Rework compositor touch hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CR feedback - accumulate LayoutRects instead of IntRects, disable when page isn't composited. Also… Created 7 years, 5 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
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 7322 matching lines...) Expand 10 before | Expand all | Expand 10 after
7333 pos = FloatPoint(additionalOffset.x() + box->x(), additional Offset.y() + box->y()); 7333 pos = FloatPoint(additionalOffset.x() + box->x(), additional Offset.y() + box->y());
7334 box->addFocusRingRects(rects, flooredLayoutPoint(pos), paintCont ainer); 7334 box->addFocusRingRects(rects, flooredLayoutPoint(pos), paintCont ainer);
7335 } 7335 }
7336 } 7336 }
7337 } 7337 }
7338 7338
7339 if (inlineElementContinuation()) 7339 if (inlineElementContinuation())
7340 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer); 7340 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer);
7341 } 7341 }
7342 7342
7343 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const
7344 {
7345 RenderBox::computeSelfHitTestRects(rects, layerOffset);
7346
7347 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) {
7348 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
7349 LayoutUnit top = max<LayoutUnit>(curr->lineTop(), curr->top());
7350 LayoutUnit bottom = min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height());
7351 LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, curr->width(), bottom - top);
7352 // It's common for this rect to be entirely contained in our box, so exclude that simple case.
7353 if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect)) )
7354 rects.append(rect);
7355 }
7356 }
7357 }
7358
7343 RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* par ent) const 7359 RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* par ent) const
7344 { 7360 {
7345 if (isAnonymousColumnsBlock()) 7361 if (isAnonymousColumnsBlock())
7346 return createAnonymousColumnsWithParentRenderer(parent); 7362 return createAnonymousColumnsWithParentRenderer(parent);
7347 if (isAnonymousColumnSpanBlock()) 7363 if (isAnonymousColumnSpanBlock())
7348 return createAnonymousColumnSpanWithParentRenderer(parent); 7364 return createAnonymousColumnSpanWithParentRenderer(parent);
7349 return createAnonymousWithParentRendererAndDisplay(parent, style()->display( )); 7365 return createAnonymousWithParentRendererAndDisplay(parent, style()->display( ));
7350 } 7366 }
7351 7367
7352 bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBou ndaryRule) const 7368 bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBou ndaryRule) const
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
8241 } 8257 }
8242 8258
8243 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 8259 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
8244 { 8260 {
8245 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped MaxY()); 8261 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped MaxY());
8246 } 8262 }
8247 8263
8248 #endif 8264 #endif
8249 8265
8250 } // namespace WebCore 8266 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698