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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1532923002: Add a Path::contains() version that use the Path's winding rule (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward declare Path in GC.h Created 5 years 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, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 1989
1990 LayoutPoint offsetToRootLayer; 1990 LayoutPoint offsetToRootLayer;
1991 if (rootLayer) 1991 if (rootLayer)
1992 convertToLayerCoords(rootLayer, offsetToRootLayer); 1992 convertToLayerCoords(rootLayer, offsetToRootLayer);
1993 LayoutRect rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndSta ckingChildren(offsetToRootLayer); 1993 LayoutRect rootRelativeBounds = physicalBoundingBoxIncludingReflectionAndSta ckingChildren(offsetToRootLayer);
1994 1994
1995 ClipPathOperation* clipPathOperation = layoutObject()->style()->clipPath(); 1995 ClipPathOperation* clipPathOperation = layoutObject()->style()->clipPath();
1996 ASSERT(clipPathOperation); 1996 ASSERT(clipPathOperation);
1997 if (clipPathOperation->type() == ClipPathOperation::SHAPE) { 1997 if (clipPathOperation->type() == ClipPathOperation::SHAPE) {
1998 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPathOper ation); 1998 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPathOper ation);
1999 if (!clipPath->path(FloatRect(rootRelativeBounds)).contains(FloatPoint(h itTestLocation.point()), clipPath->windRule())) 1999 if (!clipPath->path(FloatRect(rootRelativeBounds)).contains(FloatPoint(h itTestLocation.point())))
2000 return true; 2000 return true;
2001 } else { 2001 } else {
2002 ASSERT(clipPathOperation->type() == ClipPathOperation::REFERENCE); 2002 ASSERT(clipPathOperation->type() == ClipPathOperation::REFERENCE);
2003 ReferenceClipPathOperation* referenceClipPathOperation = toReferenceClip PathOperation(clipPathOperation); 2003 ReferenceClipPathOperation* referenceClipPathOperation = toReferenceClip PathOperation(clipPathOperation);
2004 Element* element = layoutObject()->document().getElementById(referenceCl ipPathOperation->fragment()); 2004 Element* element = layoutObject()->document().getElementById(referenceCl ipPathOperation->fragment());
2005 if (isSVGClipPathElement(element) && element->layoutObject()) { 2005 if (isSVGClipPathElement(element) && element->layoutObject()) {
2006 LayoutSVGResourceClipper* clipper = toLayoutSVGResourceClipper(toLay outSVGResourceContainer(element->layoutObject())); 2006 LayoutSVGResourceClipper* clipper = toLayoutSVGResourceClipper(toLay outSVGResourceContainer(element->layoutObject()));
2007 if (!clipper->hitTestClipContent(FloatRect(rootRelativeBounds), Floa tPoint(hitTestLocation.point()))) 2007 if (!clipper->hitTestClipContent(FloatRect(rootRelativeBounds), Floa tPoint(hitTestLocation.point())))
2008 return true; 2008 return true;
2009 } 2009 }
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 2830
2831 void showLayerTree(const blink::LayoutObject* layoutObject) 2831 void showLayerTree(const blink::LayoutObject* layoutObject)
2832 { 2832 {
2833 if (!layoutObject) { 2833 if (!layoutObject) {
2834 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2834 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2835 return; 2835 return;
2836 } 2836 }
2837 showLayerTree(layoutObject->enclosingLayer()); 2837 showLayerTree(layoutObject->enclosingLayer());
2838 } 2838 }
2839 #endif 2839 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ClipPathOperation.h ('k') | third_party/WebKit/Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698