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

Side by Side Diff: Source/core/layout/svg/LayoutSVGImage.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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) 2006 Alexander Kellett <lypanov@kde.org> 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org>
6 * Copyright (C) 2009 Google, Inc. 6 * Copyright (C) 2009 Google, Inc.
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, result.hitTestRequest(), style()->pointerEvents()); 163 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, result.hitTestRequest(), style()->pointerEvents());
164 bool isVisible = (style()->visibility() == VISIBLE); 164 bool isVisible = (style()->visibility() == VISIBLE);
165 if (isVisible || !hitRules.requireVisible) { 165 if (isVisible || !hitRules.requireVisible) {
166 FloatPoint localPoint; 166 FloatPoint localPoint;
167 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localT oParentTransform(), pointInParent, localPoint)) 167 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localT oParentTransform(), pointInParent, localPoint))
168 return false; 168 return false;
169 169
170 if (hitRules.canHitFill || hitRules.canHitBoundingBox) { 170 if (hitRules.canHitFill || hitRules.canHitBoundingBox) {
171 if (m_objectBoundingBox.contains(localPoint)) { 171 if (m_objectBoundingBox.contains(localPoint)) {
172 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 172 updateHitTestResult(result, roundedLayoutPoint(localPoint), boun dingRect(result.hitTestLocation().point()));
173 return true; 173 return true;
174 } 174 }
175 } 175 }
176 } 176 }
177 177
178 return false; 178 return false;
179 } 179 }
180 180
181 void LayoutSVGImage::imageChanged(WrappedImagePtr, const IntRect*) 181 void LayoutSVGImage::imageChanged(WrappedImagePtr, const IntRect*)
182 { 182 {
(...skipping 17 matching lines...) Expand all
200 200
201 void LayoutSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const 201 void LayoutSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const
202 { 202 {
203 // this is called from paint() after the localTransform has already been app lied 203 // this is called from paint() after the localTransform has already been app lied
204 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates( )); 204 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates( ));
205 if (!contentRect.isEmpty()) 205 if (!contentRect.isEmpty())
206 rects.append(contentRect); 206 rects.append(contentRect);
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698