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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1390933003: Implement the framework for the paint property hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "core/layout/LayoutScrollbarPart.h" 65 #include "core/layout/LayoutScrollbarPart.h"
66 #include "core/layout/LayoutTreeAsText.h" 66 #include "core/layout/LayoutTreeAsText.h"
67 #include "core/layout/LayoutView.h" 67 #include "core/layout/LayoutView.h"
68 #include "core/layout/compositing/CompositedLayerMapping.h" 68 #include "core/layout/compositing/CompositedLayerMapping.h"
69 #include "core/layout/compositing/PaintLayerCompositor.h" 69 #include "core/layout/compositing/PaintLayerCompositor.h"
70 #include "core/layout/svg/LayoutSVGRoot.h" 70 #include "core/layout/svg/LayoutSVGRoot.h"
71 #include "core/layout/svg/ReferenceFilterBuilder.h" 71 #include "core/layout/svg/ReferenceFilterBuilder.h"
72 #include "core/page/Page.h" 72 #include "core/page/Page.h"
73 #include "core/page/scrolling/ScrollingCoordinator.h" 73 #include "core/page/scrolling/ScrollingCoordinator.h"
74 #include "core/paint/FilterEffectBuilder.h" 74 #include "core/paint/FilterEffectBuilder.h"
75 #include "core/paint/ObjectPaintProperties.h"
75 #include "platform/LengthFunctions.h" 76 #include "platform/LengthFunctions.h"
76 #include "platform/RuntimeEnabledFeatures.h" 77 #include "platform/RuntimeEnabledFeatures.h"
77 #include "platform/TraceEvent.h" 78 #include "platform/TraceEvent.h"
78 #include "platform/geometry/FloatPoint3D.h" 79 #include "platform/geometry/FloatPoint3D.h"
79 #include "platform/geometry/FloatRect.h" 80 #include "platform/geometry/FloatRect.h"
80 #include "platform/geometry/TransformState.h" 81 #include "platform/geometry/TransformState.h"
81 #include "platform/graphics/filters/Filter.h" 82 #include "platform/graphics/filters/Filter.h"
82 #include "platform/graphics/filters/SourceGraphic.h" 83 #include "platform/graphics/filters/SourceGraphic.h"
83 #include "platform/transforms/ScaleTransformOperation.h" 84 #include "platform/transforms/ScaleTransformOperation.h"
84 #include "platform/transforms/TransformationMatrix.h" 85 #include "platform/transforms/TransformationMatrix.h"
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 if (container->m_needsRepaint) 2708 if (container->m_needsRepaint)
2708 break; 2709 break;
2709 container->m_needsRepaint = true; 2710 container->m_needsRepaint = true;
2710 } 2711 }
2711 if (container->compositingState() != NotComposited) 2712 if (container->compositingState() != NotComposited)
2712 break; 2713 break;
2713 layer = container; 2714 layer = container;
2714 } 2715 }
2715 } 2716 }
2716 2717
2718 void PaintLayer::setPaintProperties(PassOwnPtr<ObjectPaintProperties> paintPrope rties)
jbroman 2015/10/07 15:22:22 nit: I'd rather the caller be able to update the e
pdr. 2015/10/07 20:19:11 Done. Changed to non-const mutablePaintProperties(
2719 {
2720 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2721 ASSERT(layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InUpdatePaintProperties);
2722 m_paintProperties = paintProperties;
2723 }
2724
2725 const ObjectPaintProperties* PaintLayer::paintProperties() const
2726 {
2727 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2728 ASSERT(layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InPaint);
2729 return m_paintProperties.get();
2730 }
2731
2717 DisableCompositingQueryAsserts::DisableCompositingQueryAsserts() 2732 DisableCompositingQueryAsserts::DisableCompositingQueryAsserts()
2718 : m_disabler(gCompositingQueryMode, CompositingQueriesAreAllowed) { } 2733 : m_disabler(gCompositingQueryMode, CompositingQueriesAreAllowed) { }
2719 2734
2720 } // namespace blink 2735 } // namespace blink
2721 2736
2722 #ifndef NDEBUG 2737 #ifndef NDEBUG
2723 // FIXME: Rename? 2738 // FIXME: Rename?
2724 void showLayerTree(const blink::PaintLayer* layer) 2739 void showLayerTree(const blink::PaintLayer* layer)
2725 { 2740 {
2726 if (!layer) { 2741 if (!layer) {
2727 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2742 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2728 return; 2743 return;
2729 } 2744 }
2730 2745
2731 if (blink::LocalFrame* frame = layer->layoutObject()->frame()) { 2746 if (blink::LocalFrame* frame = layer->layoutObject()->frame()) {
2732 WTF::String output = externalRepresentation(frame, blink::LayoutAsTextSh owAllLayers | blink::LayoutAsTextShowLayerNesting | blink::LayoutAsTextShowCompo sitedLayers | blink::LayoutAsTextShowAddresses | blink::LayoutAsTextShowIDAndCla ss | blink::LayoutAsTextDontUpdateLayout | blink::LayoutAsTextShowLayoutState); 2747 WTF::String output = externalRepresentation(frame, blink::LayoutAsTextSh owAllLayers | blink::LayoutAsTextShowLayerNesting | blink::LayoutAsTextShowCompo sitedLayers | blink::LayoutAsTextShowAddresses | blink::LayoutAsTextShowIDAndCla ss | blink::LayoutAsTextDontUpdateLayout | blink::LayoutAsTextShowLayoutState);
2733 fprintf(stderr, "%s\n", output.utf8().data()); 2748 fprintf(stderr, "%s\n", output.utf8().data());
2734 } 2749 }
2735 } 2750 }
2736 2751
2737 void showLayerTree(const blink::LayoutObject* layoutObject) 2752 void showLayerTree(const blink::LayoutObject* layoutObject)
2738 { 2753 {
2739 if (!layoutObject) { 2754 if (!layoutObject) {
2740 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2755 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2741 return; 2756 return;
2742 } 2757 }
2743 showLayerTree(layoutObject->enclosingLayer()); 2758 showLayerTree(layoutObject->enclosingLayer());
2744 } 2759 }
2745 #endif 2760 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698