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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2713673005: client-goodbye
Patch Set: Created 3 years, 9 months 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 // FIXME: need to split out paint invalidations for the background. 2759 // FIXME: need to split out paint invalidations for the background.
2760 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), 2760 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(),
2761 ApplyToContentLayers); 2761 ApplyToContentLayers);
2762 } 2762 }
2763 2763
2764 struct SetContentsNeedsDisplayInRectFunctor { 2764 struct SetContentsNeedsDisplayInRectFunctor {
2765 void operator()(GraphicsLayer* layer) const { 2765 void operator()(GraphicsLayer* layer) const {
2766 if (layer->drawsContent()) { 2766 if (layer->drawsContent()) {
2767 IntRect layerDirtyRect = r; 2767 IntRect layerDirtyRect = r;
2768 layerDirtyRect.move(-layer->offsetFromLayoutObject()); 2768 layerDirtyRect.move(-layer->offsetFromLayoutObject());
2769 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason, client); 2769 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason, debug);
2770 } 2770 }
2771 } 2771 }
2772 2772
2773 IntRect r; 2773 IntRect r;
2774 PaintInvalidationReason invalidationReason; 2774 PaintInvalidationReason invalidationReason;
2775 const DisplayItemClient& client; 2775 const InvalidationDebugging& debug;
2776 }; 2776 };
2777 2777
2778 void CompositedLayerMapping::setContentsNeedDisplayInRect( 2778 void CompositedLayerMapping::setContentsNeedDisplayInRect(
2779 const LayoutRect& r, 2779 const LayoutRect& r,
2780 PaintInvalidationReason invalidationReason, 2780 PaintInvalidationReason invalidationReason,
2781 const DisplayItemClient& client) { 2781 const InvalidationDebugging& debug) {
2782 DCHECK(!m_owningLayer.layoutObject()->usesCompositedScrolling()); 2782 DCHECK(!m_owningLayer.layoutObject()->usesCompositedScrolling());
2783 // TODO(wangxianzhu): Enable the following assert after paint invalidation for 2783 // TODO(wangxianzhu): Enable the following assert after paint invalidation for
2784 // spv2 is ready. 2784 // spv2 is ready.
2785 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2785 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2786 2786
2787 SetContentsNeedsDisplayInRectFunctor functor = { 2787 SetContentsNeedsDisplayInRectFunctor functor = {
2788 enclosingIntRect(LayoutRect( 2788 enclosingIntRect(LayoutRect(
2789 r.location() + m_owningLayer.subpixelAccumulation(), r.size())), 2789 r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
2790 invalidationReason, client}; 2790 invalidationReason, debug};
2791 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); 2791 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
2792 } 2792 }
2793 2793
2794 void CompositedLayerMapping::setNonScrollingContentsNeedDisplayInRect( 2794 void CompositedLayerMapping::setNonScrollingContentsNeedDisplayInRect(
2795 const LayoutRect& r, 2795 const LayoutRect& r,
2796 PaintInvalidationReason invalidationReason, 2796 PaintInvalidationReason invalidationReason,
2797 const DisplayItemClient& client) { 2797 const InvalidationDebugging& debug) {
2798 DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling()); 2798 DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling());
2799 // TODO(wangxianzhu): Enable the following assert after paint invalidation for 2799 // TODO(wangxianzhu): Enable the following assert after paint invalidation for
2800 // spv2 is ready. 2800 // spv2 is ready.
2801 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2801 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2802 2802
2803 SetContentsNeedsDisplayInRectFunctor functor = { 2803 SetContentsNeedsDisplayInRectFunctor functor = {
2804 enclosingIntRect(LayoutRect( 2804 enclosingIntRect(LayoutRect(
2805 r.location() + m_owningLayer.subpixelAccumulation(), r.size())), 2805 r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
2806 invalidationReason, client}; 2806 invalidationReason, debug};
2807 ApplyToGraphicsLayers(this, functor, ApplyToNonScrollingContentLayers); 2807 ApplyToGraphicsLayers(this, functor, ApplyToNonScrollingContentLayers);
2808 } 2808 }
2809 2809
2810 void CompositedLayerMapping::setScrollingContentsNeedDisplayInRect( 2810 void CompositedLayerMapping::setScrollingContentsNeedDisplayInRect(
2811 const LayoutRect& r, 2811 const LayoutRect& r,
2812 PaintInvalidationReason invalidationReason, 2812 PaintInvalidationReason invalidationReason,
2813 const DisplayItemClient& client) { 2813 const InvalidationDebugging& debug) {
2814 DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling()); 2814 DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling());
2815 // TODO(wangxianzhu): Enable the following assert after paint invalidation for 2815 // TODO(wangxianzhu): Enable the following assert after paint invalidation for
2816 // spv2 is ready. 2816 // spv2 is ready.
2817 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2817 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2818 2818
2819 SetContentsNeedsDisplayInRectFunctor functor = { 2819 SetContentsNeedsDisplayInRectFunctor functor = {
2820 enclosingIntRect(LayoutRect( 2820 enclosingIntRect(LayoutRect(
2821 r.location() + m_owningLayer.subpixelAccumulation(), r.size())), 2821 r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
2822 invalidationReason, client}; 2822 invalidationReason, debug};
2823 ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentLayers); 2823 ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentLayers);
2824 } 2824 }
2825 2825
2826 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer( 2826 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(
2827 const LayoutObject* layoutObject, 2827 const LayoutObject* layoutObject,
2828 const Vector<GraphicsLayerPaintInfo>& layers, 2828 const Vector<GraphicsLayerPaintInfo>& layers,
2829 unsigned maxSquashedLayerIndex) { 2829 unsigned maxSquashedLayerIndex) {
2830 if (!layoutObject) 2830 if (!layoutObject)
2831 return nullptr; 2831 return nullptr;
2832 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { 2832 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2882 const GraphicsLayerPaintInfo& paintInfo, 2882 const GraphicsLayerPaintInfo& paintInfo,
2883 const GraphicsLayer& graphicsLayer, 2883 const GraphicsLayer& graphicsLayer,
2884 const PaintLayerFlags& paintLayerFlags, 2884 const PaintLayerFlags& paintLayerFlags,
2885 GraphicsContext& context, 2885 GraphicsContext& context,
2886 const IntRect& clip /* In the coords of rootLayer */) const { 2886 const IntRect& clip /* In the coords of rootLayer */) const {
2887 FontCachePurgePreventer fontCachePurgePreventer; 2887 FontCachePurgePreventer fontCachePurgePreventer;
2888 2888
2889 IntSize offset = paintInfo.offsetFromLayoutObject; 2889 IntSize offset = paintInfo.offsetFromLayoutObject;
2890 AffineTransform translation; 2890 AffineTransform translation;
2891 translation.translate(-offset.width(), -offset.height()); 2891 translation.translate(-offset.width(), -offset.height());
2892 TransformRecorder transformRecorder(context, graphicsLayer, translation); 2892 TransformRecorder transformRecorder(
2893 context, translation, graphicsLayer.visualRect(),
2894 graphicsLayer.debugName(),
2895 graphicsLayer.paintedOutputOfObjectHasNoEffectRegardlessOfSize());
2893 2896
2894 // The dirtyRect is in the coords of the painting root. 2897 // The dirtyRect is in the coords of the painting root.
2895 IntRect dirtyRect(clip); 2898 IntRect dirtyRect(clip);
2896 dirtyRect.move(offset); 2899 dirtyRect.move(offset);
2897 2900
2898 if (paintLayerFlags & (PaintLayerPaintingOverflowContents | 2901 if (paintLayerFlags & (PaintLayerPaintingOverflowContents |
2899 PaintLayerPaintingAncestorClippingMaskPhase)) { 2902 PaintLayerPaintingAncestorClippingMaskPhase)) {
2900 dirtyRect.move( 2903 dirtyRect.move(
2901 roundedIntSize(paintInfo.paintLayer->subpixelAccumulation())); 2904 roundedIntSize(paintInfo.paintLayer->subpixelAccumulation()));
2902 } else { 2905 } else {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 } 2956 }
2954 2957
2955 static void paintScrollbar(const Scrollbar* scrollbar, 2958 static void paintScrollbar(const Scrollbar* scrollbar,
2956 GraphicsContext& context, 2959 GraphicsContext& context,
2957 const IntRect& clip) { 2960 const IntRect& clip) {
2958 if (!scrollbar) 2961 if (!scrollbar)
2959 return; 2962 return;
2960 2963
2961 const IntRect& scrollbarRect = scrollbar->frameRect(); 2964 const IntRect& scrollbarRect = scrollbar->frameRect();
2962 TransformRecorder transformRecorder( 2965 TransformRecorder transformRecorder(
2963 context, *scrollbar, 2966 context,
2964 AffineTransform::translation(-scrollbarRect.x(), -scrollbarRect.y())); 2967 AffineTransform::translation(-scrollbarRect.x(), -scrollbarRect.y()),
2968 scrollbar->visualRect(), scrollbar->debugName(),
2969 scrollbar->paintedOutputOfObjectHasNoEffectRegardlessOfSize());
2965 IntRect transformedClip = clip; 2970 IntRect transformedClip = clip;
2966 transformedClip.moveBy(scrollbarRect.location()); 2971 transformedClip.moveBy(scrollbarRect.location());
2967 scrollbar->paint(context, CullRect(transformedClip)); 2972 scrollbar->paint(context, CullRect(transformedClip));
2968 } 2973 }
2969 2974
2970 // TODO(eseckler): Make recording distance configurable, e.g. for use in 2975 // TODO(eseckler): Make recording distance configurable, e.g. for use in
2971 // headless, where we would like to record an exact area. 2976 // headless, where we would like to record an exact area.
2972 // Note however that the minimum value for this constant is the size of a 2977 // Note however that the minimum value for this constant is the size of a
2973 // raster tile. This is because the raster system is not able to raster a 2978 // raster tile. This is because the raster system is not able to raster a
2974 // tile that is not completely covered by a display list. If the constant 2979 // tile that is not completely covered by a display list. If the constant
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
3478 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3483 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3479 name = "Decoration Layer"; 3484 name = "Decoration Layer";
3480 } else { 3485 } else {
3481 ASSERT_NOT_REACHED(); 3486 ASSERT_NOT_REACHED();
3482 } 3487 }
3483 3488
3484 return name; 3489 return name;
3485 } 3490 }
3486 3491
3487 } // namespace blink 3492 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698