| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 if (!result.hitTestRequest().listBased()) | 2332 if (!result.hitTestRequest().listBased()) |
| 2333 result = tempResult; | 2333 result = tempResult; |
| 2334 if (!depthSortDescendants) | 2334 if (!depthSortDescendants) |
| 2335 break; | 2335 break; |
| 2336 } | 2336 } |
| 2337 } | 2337 } |
| 2338 | 2338 |
| 2339 return resultLayer; | 2339 return resultLayer; |
| 2340 } | 2340 } |
| 2341 | 2341 |
| 2342 FloatRect PaintLayer::boxForFilter() const { | 2342 FloatRect PaintLayer::boxForFilterOrMask() const { |
| 2343 return FloatRect(physicalBoundingBoxIncludingStackingChildren( | 2343 return FloatRect(physicalBoundingBoxIncludingStackingChildren( |
| 2344 LayoutPoint(), PaintLayer::CalculateBoundsOptions:: | 2344 LayoutPoint(), PaintLayer::CalculateBoundsOptions:: |
| 2345 IncludeTransformsAndCompositedChildLayers)); | 2345 IncludeTransformsAndCompositedChildLayers)); |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 LayoutRect PaintLayer::boxForClipPath() const { | 2348 LayoutRect PaintLayer::boxForClipPath() const { |
| 2349 if (!layoutObject()->isBox()) { | 2349 if (!layoutObject()->isBox()) { |
| 2350 SECURITY_DCHECK(layoutObject()->isLayoutInline()); | 2350 SECURITY_DCHECK(layoutObject()->isLayoutInline()); |
| 2351 const LayoutInline& layoutInline = toLayoutInline(*layoutObject()); | 2351 const LayoutInline& layoutInline = toLayoutInline(*layoutObject()); |
| 2352 // This somewhat convoluted computation matches what Gecko does. | 2352 // This somewhat convoluted computation matches what Gecko does. |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3015 BoxReflectFilterOperation::create(reflection)); | 3015 BoxReflectFilterOperation::create(reflection)); |
| 3016 } | 3016 } |
| 3017 return filterOperations; | 3017 return filterOperations; |
| 3018 } | 3018 } |
| 3019 | 3019 |
| 3020 CompositorFilterOperations | 3020 CompositorFilterOperations |
| 3021 PaintLayer::createCompositorFilterOperationsForFilter( | 3021 PaintLayer::createCompositorFilterOperationsForFilter( |
| 3022 const ComputedStyle& style) { | 3022 const ComputedStyle& style) { |
| 3023 FloatRect zoomedReferenceBox; | 3023 FloatRect zoomedReferenceBox; |
| 3024 if (style.filter().hasReferenceFilter()) | 3024 if (style.filter().hasReferenceFilter()) |
| 3025 zoomedReferenceBox = boxForFilter(); | 3025 zoomedReferenceBox = boxForFilterOrMask(); |
| 3026 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, | 3026 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, |
| 3027 style.effectiveZoom()); | 3027 style.effectiveZoom()); |
| 3028 return builder.buildFilterOperations(addReflectionToFilterOperations(style)); | 3028 return builder.buildFilterOperations(addReflectionToFilterOperations(style)); |
| 3029 } | 3029 } |
| 3030 | 3030 |
| 3031 CompositorFilterOperations | 3031 CompositorFilterOperations |
| 3032 PaintLayer::createCompositorFilterOperationsForBackdropFilter( | 3032 PaintLayer::createCompositorFilterOperationsForBackdropFilter( |
| 3033 const ComputedStyle& style) { | 3033 const ComputedStyle& style) { |
| 3034 FloatRect zoomedReferenceBox; | 3034 FloatRect zoomedReferenceBox; |
| 3035 if (style.backdropFilter().hasReferenceFilter()) | 3035 if (style.backdropFilter().hasReferenceFilter()) |
| 3036 zoomedReferenceBox = boxForFilter(); | 3036 zoomedReferenceBox = boxForFilterOrMask(); |
| 3037 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, | 3037 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, |
| 3038 style.effectiveZoom()); | 3038 style.effectiveZoom()); |
| 3039 return builder.buildFilterOperations(style.backdropFilter()); | 3039 return builder.buildFilterOperations(style.backdropFilter()); |
| 3040 } | 3040 } |
| 3041 | 3041 |
| 3042 PaintLayerResourceInfo& PaintLayer::ensureResourceInfo() { | 3042 PaintLayerResourceInfo& PaintLayer::ensureResourceInfo() { |
| 3043 PaintLayerRareData& rareData = ensureRareData(); | 3043 PaintLayerRareData& rareData = ensureRareData(); |
| 3044 if (!rareData.resourceInfo) | 3044 if (!rareData.resourceInfo) |
| 3045 rareData.resourceInfo = new PaintLayerResourceInfo(this); | 3045 rareData.resourceInfo = new PaintLayerResourceInfo(this); |
| 3046 return *rareData.resourceInfo; | 3046 return *rareData.resourceInfo; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3074 return nullptr; | 3074 return nullptr; |
| 3075 PaintLayerResourceInfo* resourceInfo = this->resourceInfo(); | 3075 PaintLayerResourceInfo* resourceInfo = this->resourceInfo(); |
| 3076 DCHECK(resourceInfo); | 3076 DCHECK(resourceInfo); |
| 3077 | 3077 |
| 3078 if (resourceInfo->lastEffect()) | 3078 if (resourceInfo->lastEffect()) |
| 3079 return resourceInfo->lastEffect(); | 3079 return resourceInfo->lastEffect(); |
| 3080 | 3080 |
| 3081 const ComputedStyle& style = layoutObject()->styleRef(); | 3081 const ComputedStyle& style = layoutObject()->styleRef(); |
| 3082 FloatRect zoomedReferenceBox; | 3082 FloatRect zoomedReferenceBox; |
| 3083 if (style.filter().hasReferenceFilter()) | 3083 if (style.filter().hasReferenceFilter()) |
| 3084 zoomedReferenceBox = boxForFilter(); | 3084 zoomedReferenceBox = boxForFilterOrMask(); |
| 3085 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, | 3085 FilterEffectBuilder builder(enclosingNode(), zoomedReferenceBox, |
| 3086 style.effectiveZoom()); | 3086 style.effectiveZoom()); |
| 3087 resourceInfo->setLastEffect( | 3087 resourceInfo->setLastEffect( |
| 3088 builder.buildFilterEffect(addReflectionToFilterOperations(style))); | 3088 builder.buildFilterEffect(addReflectionToFilterOperations(style))); |
| 3089 return resourceInfo->lastEffect(); | 3089 return resourceInfo->lastEffect(); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 FloatRect PaintLayer::mapRectForFilter(const FloatRect& rect) const { | 3092 FloatRect PaintLayer::mapRectForFilter(const FloatRect& rect) const { |
| 3093 if (!hasFilterThatMovesPixels()) | 3093 if (!hasFilterThatMovesPixels()) |
| 3094 return rect; | 3094 return rect; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3252 void showLayerTree(const blink::LayoutObject* layoutObject) { |
| 3253 if (!layoutObject) { | 3253 if (!layoutObject) { |
| 3254 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3254 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
| 3255 return; | 3255 return; |
| 3256 } | 3256 } |
| 3257 showLayerTree(layoutObject->enclosingLayer()); | 3257 showLayerTree(layoutObject->enclosingLayer()); |
| 3258 } | 3258 } |
| 3259 #endif | 3259 #endif |
| OLD | NEW |