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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bool DeprecatedPaintLayer::paintsWithFilters() const | 216 bool DeprecatedPaintLayer::paintsWithFilters() const |
217 { | 217 { |
218 if (!layoutObject()->hasFilter()) | 218 if (!layoutObject()->hasFilter()) |
219 return false; | 219 return false; |
220 | 220 |
221 // https://code.google.com/p/chromium/issues/detail?id=343759 | 221 // https://code.google.com/p/chromium/issues/detail?id=343759 |
222 DisableCompositingQueryAsserts disabler; | 222 DisableCompositingQueryAsserts disabler; |
223 return !m_compositedDeprecatedPaintLayerMapping || compositingState() != Pai
ntsIntoOwnBacking; | 223 return !m_compositedDeprecatedPaintLayerMapping || compositingState() != Pai
ntsIntoOwnBacking; |
224 } | 224 } |
225 | 225 |
| 226 bool DeprecatedPaintLayer::paintsWithBackdropFilters() const |
| 227 { |
| 228 if (!layoutObject()->hasBackdropFilter()) |
| 229 return false; |
| 230 |
| 231 // https://code.google.com/p/chromium/issues/detail?id=343759 |
| 232 DisableCompositingQueryAsserts disabler; |
| 233 return !m_compositedDeprecatedPaintLayerMapping || compositingState() != Pai
ntsIntoOwnBacking; |
| 234 } |
| 235 |
226 LayoutSize DeprecatedPaintLayer::subpixelAccumulation() const | 236 LayoutSize DeprecatedPaintLayer::subpixelAccumulation() const |
227 { | 237 { |
228 return m_subpixelAccumulation; | 238 return m_subpixelAccumulation; |
229 } | 239 } |
230 | 240 |
231 void DeprecatedPaintLayer::setSubpixelAccumulation(const LayoutSize& size) | 241 void DeprecatedPaintLayer::setSubpixelAccumulation(const LayoutSize& size) |
232 { | 242 { |
233 m_subpixelAccumulation = size; | 243 m_subpixelAccumulation = size; |
234 } | 244 } |
235 | 245 |
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 } | 2544 } |
2535 | 2545 |
2536 bool DeprecatedPaintLayer::scrollsOverflow() const | 2546 bool DeprecatedPaintLayer::scrollsOverflow() const |
2537 { | 2547 { |
2538 if (DeprecatedPaintLayerScrollableArea* scrollableArea = this->scrollableAre
a()) | 2548 if (DeprecatedPaintLayerScrollableArea* scrollableArea = this->scrollableAre
a()) |
2539 return scrollableArea->scrollsOverflow(); | 2549 return scrollableArea->scrollsOverflow(); |
2540 | 2550 |
2541 return false; | 2551 return false; |
2542 } | 2552 } |
2543 | 2553 |
2544 FilterOperations DeprecatedPaintLayer::computeFilterOperations(const ComputedSty
le& style) | 2554 namespace { |
| 2555 |
| 2556 FilterOperations computeFilterOperationsHandleReferenceFilters(const FilterOpera
tions& filters, float effectiveZoom, Node* enclosingElement) |
2545 { | 2557 { |
2546 const FilterOperations& filters = style.filter(); | |
2547 if (filters.hasReferenceFilter()) { | 2558 if (filters.hasReferenceFilter()) { |
2548 for (size_t i = 0; i < filters.size(); ++i) { | 2559 for (size_t i = 0; i < filters.size(); ++i) { |
2549 FilterOperation* filterOperation = filters.operations().at(i).get(); | 2560 FilterOperation* filterOperation = filters.operations().at(i).get(); |
2550 if (filterOperation->type() != FilterOperation::REFERENCE) | 2561 if (filterOperation->type() != FilterOperation::REFERENCE) |
2551 continue; | 2562 continue; |
2552 ReferenceFilterOperation& referenceOperation = toReferenceFilterOper
ation(*filterOperation); | 2563 ReferenceFilterOperation& referenceOperation = toReferenceFilterOper
ation(*filterOperation); |
2553 // FIXME: Cache the ReferenceFilter if it didn't change. | 2564 // FIXME: Cache the ReferenceFilter if it didn't change. |
2554 RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilte
rBuilder::build(style.effectiveZoom(), toElement(enclosingElement()), nullptr, r
eferenceOperation); | 2565 RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilte
rBuilder::build(effectiveZoom, toElement(enclosingElement), nullptr, referenceOp
eration); |
2555 referenceOperation.setFilter(referenceFilter.release()); | 2566 referenceOperation.setFilter(referenceFilter.release()); |
2556 } | 2567 } |
2557 } | 2568 } |
2558 | 2569 |
2559 return filters; | 2570 return filters; |
2560 } | 2571 } |
2561 | 2572 |
| 2573 } // unnamed namespace |
| 2574 |
| 2575 FilterOperations DeprecatedPaintLayer::computeFilterOperations(const ComputedSty
le& style) |
| 2576 { |
| 2577 return computeFilterOperationsHandleReferenceFilters(style.filter(), style.e
ffectiveZoom(), enclosingElement()); |
| 2578 } |
| 2579 |
| 2580 FilterOperations DeprecatedPaintLayer::computeBackdropFilterOperations(const Com
putedStyle& style) |
| 2581 { |
| 2582 return computeFilterOperationsHandleReferenceFilters(style.backdropFilter(),
style.effectiveZoom(), enclosingElement()); |
| 2583 } |
| 2584 |
2562 void DeprecatedPaintLayer::updateOrRemoveFilterClients() | 2585 void DeprecatedPaintLayer::updateOrRemoveFilterClients() |
2563 { | 2586 { |
2564 if (!hasFilter()) { | 2587 if (!hasFilter()) { |
2565 removeFilterInfoIfNeeded(); | 2588 removeFilterInfoIfNeeded(); |
2566 return; | 2589 return; |
2567 } | 2590 } |
2568 | 2591 |
2569 if (layoutObject()->style()->filter().hasReferenceFilter()) | 2592 if (layoutObject()->style()->filter().hasReferenceFilter()) |
2570 ensureFilterInfo()->updateReferenceFilterClients(layoutObject()->style()
->filter()); | 2593 ensureFilterInfo()->updateReferenceFilterClients(layoutObject()->style()
->filter()); |
2571 else if (hasFilterInfo()) | 2594 else if (hasFilterInfo()) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 | 2694 |
2672 void showLayerTree(const blink::LayoutObject* layoutObject) | 2695 void showLayerTree(const blink::LayoutObject* layoutObject) |
2673 { | 2696 { |
2674 if (!layoutObject) { | 2697 if (!layoutObject) { |
2675 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2698 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2676 return; | 2699 return; |
2677 } | 2700 } |
2678 showLayerTree(layoutObject->enclosingLayer()); | 2701 showLayerTree(layoutObject->enclosingLayer()); |
2679 } | 2702 } |
2680 #endif | 2703 #endif |
OLD | NEW |