OLD | NEW |
---|---|
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 #include "core/layout/LayoutFlowThread.h" | 59 #include "core/layout/LayoutFlowThread.h" |
60 #include "core/layout/LayoutInline.h" | 60 #include "core/layout/LayoutInline.h" |
61 #include "core/layout/LayoutPart.h" | 61 #include "core/layout/LayoutPart.h" |
62 #include "core/layout/LayoutReplica.h" | 62 #include "core/layout/LayoutReplica.h" |
63 #include "core/layout/LayoutTreeAsText.h" | 63 #include "core/layout/LayoutTreeAsText.h" |
64 #include "core/layout/LayoutView.h" | 64 #include "core/layout/LayoutView.h" |
65 #include "core/layout/compositing/CompositedLayerMapping.h" | 65 #include "core/layout/compositing/CompositedLayerMapping.h" |
66 #include "core/layout/compositing/PaintLayerCompositor.h" | 66 #include "core/layout/compositing/PaintLayerCompositor.h" |
67 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 67 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
68 #include "core/layout/svg/LayoutSVGRoot.h" | 68 #include "core/layout/svg/LayoutSVGRoot.h" |
69 #include "core/layout/svg/ReferenceFilterBuilder.h" | |
70 #include "core/page/Page.h" | 69 #include "core/page/Page.h" |
71 #include "core/page/scrolling/ScrollingCoordinator.h" | 70 #include "core/page/scrolling/ScrollingCoordinator.h" |
72 #include "core/paint/BoxReflectionUtils.h" | 71 #include "core/paint/BoxReflectionUtils.h" |
73 #include "core/paint/FilterEffectBuilder.h" | 72 #include "core/paint/FilterEffectBuilder.h" |
74 #include "core/paint/PaintTiming.h" | 73 #include "core/paint/PaintTiming.h" |
75 #include "platform/LengthFunctions.h" | 74 #include "platform/LengthFunctions.h" |
76 #include "platform/RuntimeEnabledFeatures.h" | 75 #include "platform/RuntimeEnabledFeatures.h" |
77 #include "platform/TraceEvent.h" | 76 #include "platform/TraceEvent.h" |
78 #include "platform/geometry/FloatPoint3D.h" | 77 #include "platform/geometry/FloatPoint3D.h" |
79 #include "platform/geometry/FloatRect.h" | 78 #include "platform/geometry/FloatRect.h" |
(...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2648 | 2647 |
2649 FilterOperations computeFilterOperationsHandleReferenceFilters(const FilterOpera tions& filters, float effectiveZoom, Node* enclosingNode) | 2648 FilterOperations computeFilterOperationsHandleReferenceFilters(const FilterOpera tions& filters, float effectiveZoom, Node* enclosingNode) |
2650 { | 2649 { |
2651 if (filters.hasReferenceFilter()) { | 2650 if (filters.hasReferenceFilter()) { |
2652 for (size_t i = 0; i < filters.size(); ++i) { | 2651 for (size_t i = 0; i < filters.size(); ++i) { |
2653 FilterOperation* filterOperation = filters.operations().at(i).get(); | 2652 FilterOperation* filterOperation = filters.operations().at(i).get(); |
2654 if (filterOperation->type() != FilterOperation::REFERENCE) | 2653 if (filterOperation->type() != FilterOperation::REFERENCE) |
2655 continue; | 2654 continue; |
2656 ReferenceFilterOperation& referenceOperation = toReferenceFilterOper ation(*filterOperation); | 2655 ReferenceFilterOperation& referenceOperation = toReferenceFilterOper ation(*filterOperation); |
2657 // FIXME: Cache the Filter if it didn't change. | 2656 // FIXME: Cache the Filter if it didn't change. |
2658 Filter* referenceFilter = ReferenceFilterBuilder::build(effectiveZoo m, toElement(enclosingNode), nullptr, referenceOperation); | 2657 Filter* referenceFilter = FilterEffectBuilder::buildReferenceFilter( referenceOperation, nullptr, nullptr, nullptr, *toElement(enclosingNode), nullpt r, effectiveZoom); |
2659 referenceOperation.setFilter(referenceFilter); | 2658 referenceOperation.setFilter(referenceFilter); |
2660 } | 2659 } |
2661 } | 2660 } |
2662 | |
2663 return filters; | 2661 return filters; |
2664 } | 2662 } |
2665 | 2663 |
2666 } // unnamed namespace | 2664 } // unnamed namespace |
2667 | 2665 |
2668 FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style) const | 2666 FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style) const |
2669 { | 2667 { |
2670 FilterOperations filterOperations = style.filter(); | 2668 FilterOperations filterOperations = style.filter(); |
2671 if (RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && layoutObject()-> hasReflection() && layoutObject()->isBox()) { | 2669 if (RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && layoutObject()-> hasReflection() && layoutObject()->isBox()) { |
2672 BoxReflection reflection = boxReflectionForPaintLayer(*this, style); | 2670 BoxReflection reflection = boxReflectionForPaintLayer(*this, style); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2728 PaintLayerFilterInfo* filterInfo = this->filterInfo(); | 2726 PaintLayerFilterInfo* filterInfo = this->filterInfo(); |
2729 | 2727 |
2730 // Should have been added by updateOrRemoveFilterEffectBuilder(). | 2728 // Should have been added by updateOrRemoveFilterEffectBuilder(). |
2731 ASSERT(filterInfo); | 2729 ASSERT(filterInfo); |
2732 | 2730 |
2733 if (filterInfo->builder()) | 2731 if (filterInfo->builder()) |
2734 return filterInfo->builder(); | 2732 return filterInfo->builder(); |
2735 | 2733 |
2736 filterInfo->setBuilder(FilterEffectBuilder::create()); | 2734 filterInfo->setBuilder(FilterEffectBuilder::create()); |
2737 | 2735 |
2738 float zoom = layoutObject()->style() ? layoutObject()->style()->effectiveZoo m() : 1.0f; | 2736 const ComputedStyle& style = layoutObject()->styleRef(); |
Stephen White
2016/06/08 13:53:45
<rambling> I could be misremembering, but IIRC thi
fs
2016/06/08 14:08:41
This is the style of whatever LayoutBox the PaintL
| |
2739 if (!filterInfo->builder()->build(toElement(enclosingNode()), computeFilterO perations(layoutObject()->styleRef()), zoom)) | 2737 if (!filterInfo->builder()->build(toElement(enclosingNode()), computeFilterO perations(style), style.effectiveZoom())) |
2740 filterInfo->setBuilder(nullptr); | 2738 filterInfo->setBuilder(nullptr); |
2741 | 2739 |
2742 return filterInfo->builder(); | 2740 return filterInfo->builder(); |
2743 } | 2741 } |
2744 | 2742 |
2745 FilterEffect* PaintLayer::lastFilterEffect() const | 2743 FilterEffect* PaintLayer::lastFilterEffect() const |
2746 { | 2744 { |
2747 FilterEffectBuilder* builder = updateFilterEffectBuilder(); | 2745 FilterEffectBuilder* builder = updateFilterEffectBuilder(); |
2748 if (!builder) | 2746 if (!builder) |
2749 return nullptr; | 2747 return nullptr; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2927 | 2925 |
2928 void showLayerTree(const blink::LayoutObject* layoutObject) | 2926 void showLayerTree(const blink::LayoutObject* layoutObject) |
2929 { | 2927 { |
2930 if (!layoutObject) { | 2928 if (!layoutObject) { |
2931 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2929 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2932 return; | 2930 return; |
2933 } | 2931 } |
2934 showLayerTree(layoutObject->enclosingLayer()); | 2932 showLayerTree(layoutObject->enclosingLayer()); |
2935 } | 2933 } |
2936 #endif | 2934 #endif |
OLD | NEW |