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 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2732 FilterOperations RenderLayer::computeFilterOperations(const RenderStyle* style) | 2732 FilterOperations RenderLayer::computeFilterOperations(const RenderStyle* style) |
2733 { | 2733 { |
2734 const FilterOperations& filters = style->filter(); | 2734 const FilterOperations& filters = style->filter(); |
2735 if (filters.hasReferenceFilter()) { | 2735 if (filters.hasReferenceFilter()) { |
2736 for (size_t i = 0; i < filters.size(); ++i) { | 2736 for (size_t i = 0; i < filters.size(); ++i) { |
2737 FilterOperation* filterOperation = filters.operations().at(i).get(); | 2737 FilterOperation* filterOperation = filters.operations().at(i).get(); |
2738 if (filterOperation->type() != FilterOperation::REFERENCE) | 2738 if (filterOperation->type() != FilterOperation::REFERENCE) |
2739 continue; | 2739 continue; |
2740 ReferenceFilterOperation* referenceOperation = toReferenceFilterOper
ation(filterOperation); | 2740 ReferenceFilterOperation* referenceOperation = toReferenceFilterOper
ation(filterOperation); |
2741 // FIXME: Cache the ReferenceFilter if it didn't change. | 2741 // FIXME: Cache the ReferenceFilter if it didn't change. |
2742 RefPtr<ReferenceFilter> referenceFilter = ReferenceFilter::create(st
yle->effectiveZoom()); | 2742 RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilte
r::create(style->effectiveZoom()); |
2743 referenceFilter->setLastEffect(ReferenceFilterBuilder::build(referen
ceFilter.get(), renderer(), referenceFilter->sourceGraphic(), | 2743 referenceFilter->setLastEffect(ReferenceFilterBuilder::build(referen
ceFilter.get(), renderer(), referenceFilter->sourceGraphic(), |
2744 referenceOperation)); | 2744 referenceOperation)); |
2745 referenceOperation->setFilter(referenceFilter.release()); | 2745 referenceOperation->setFilter(referenceFilter.release()); |
2746 } | 2746 } |
2747 } | 2747 } |
2748 | 2748 |
2749 return filters; | 2749 return filters; |
2750 } | 2750 } |
2751 | 2751 |
2752 void RenderLayer::updateOrRemoveFilterClients() | 2752 void RenderLayer::updateOrRemoveFilterClients() |
(...skipping 18 matching lines...) Expand all Loading... |
2771 // Don't delete the whole filter info here, because we might use it | 2771 // Don't delete the whole filter info here, because we might use it |
2772 // for loading CSS shader files. | 2772 // for loading CSS shader files. |
2773 if (RenderLayerFilterInfo* filterInfo = this->filterInfo()) | 2773 if (RenderLayerFilterInfo* filterInfo = this->filterInfo()) |
2774 filterInfo->setRenderer(nullptr); | 2774 filterInfo->setRenderer(nullptr); |
2775 | 2775 |
2776 return; | 2776 return; |
2777 } | 2777 } |
2778 | 2778 |
2779 RenderLayerFilterInfo* filterInfo = ensureFilterInfo(); | 2779 RenderLayerFilterInfo* filterInfo = ensureFilterInfo(); |
2780 if (!filterInfo->renderer()) { | 2780 if (!filterInfo->renderer()) { |
2781 RefPtr<FilterEffectRenderer> filterRenderer = FilterEffectRenderer::crea
te(); | 2781 RefPtrWillBeRawPtr<FilterEffectRenderer> filterRenderer = FilterEffectRe
nderer::create(); |
2782 filterInfo->setRenderer(filterRenderer.release()); | 2782 filterInfo->setRenderer(filterRenderer.release()); |
2783 } | 2783 } |
2784 | 2784 |
2785 // If the filter fails to build, remove it from the layer. It will still att
empt to | 2785 // If the filter fails to build, remove it from the layer. It will still att
empt to |
2786 // go through regular processing (e.g. compositing), but never apply anythin
g. | 2786 // go through regular processing (e.g. compositing), but never apply anythin
g. |
2787 if (!filterInfo->renderer()->build(renderer(), computeFilterOperations(rende
rer()->style()))) | 2787 if (!filterInfo->renderer()->build(renderer(), computeFilterOperations(rende
rer()->style()))) |
2788 filterInfo->setRenderer(nullptr); | 2788 filterInfo->setRenderer(nullptr); |
2789 } | 2789 } |
2790 | 2790 |
2791 void RenderLayer::filterNeedsPaintInvalidation() | 2791 void RenderLayer::filterNeedsPaintInvalidation() |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2870 } | 2870 } |
2871 } | 2871 } |
2872 | 2872 |
2873 void showLayerTree(const blink::RenderObject* renderer) | 2873 void showLayerTree(const blink::RenderObject* renderer) |
2874 { | 2874 { |
2875 if (!renderer) | 2875 if (!renderer) |
2876 return; | 2876 return; |
2877 showLayerTree(renderer->enclosingLayer()); | 2877 showLayerTree(renderer->enclosingLayer()); |
2878 } | 2878 } |
2879 #endif | 2879 #endif |
OLD | NEW |