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

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

Issue 1397583002: Implement the framework for a paint property hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Job insecurity: better tests, better comments, better names. 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 ObjectPaintProperties& PaintLayer::mutablePaintProperties()
2719 {
2720 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2721 ASSERT(layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InUpdatePaintProperties);
2722 if (!m_paintProperties)
2723 m_paintProperties = ObjectPaintProperties::create();
2724 return *m_paintProperties;
2725 }
2726
2727 const ObjectPaintProperties* PaintLayer::paintProperties() const
2728 {
2729 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2730 ASSERT(layoutObject()->document().lifecycle().state() == DocumentLifecycle:: InPaint);
2731 return m_paintProperties.get();
2732 }
2733
2717 DisableCompositingQueryAsserts::DisableCompositingQueryAsserts() 2734 DisableCompositingQueryAsserts::DisableCompositingQueryAsserts()
2718 : m_disabler(gCompositingQueryMode, CompositingQueriesAreAllowed) { } 2735 : m_disabler(gCompositingQueryMode, CompositingQueriesAreAllowed) { }
2719 2736
2720 } // namespace blink 2737 } // namespace blink
2721 2738
2722 #ifndef NDEBUG 2739 #ifndef NDEBUG
2723 // FIXME: Rename? 2740 // FIXME: Rename?
2724 void showLayerTree(const blink::PaintLayer* layer) 2741 void showLayerTree(const blink::PaintLayer* layer)
2725 { 2742 {
2726 if (!layer) { 2743 if (!layer) {
2727 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2744 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2728 return; 2745 return;
2729 } 2746 }
2730 2747
2731 if (blink::LocalFrame* frame = layer->layoutObject()->frame()) { 2748 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); 2749 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()); 2750 fprintf(stderr, "%s\n", output.utf8().data());
2734 } 2751 }
2735 } 2752 }
2736 2753
2737 void showLayerTree(const blink::LayoutObject* layoutObject) 2754 void showLayerTree(const blink::LayoutObject* layoutObject)
2738 { 2755 {
2739 if (!layoutObject) { 2756 if (!layoutObject) {
2740 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2757 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2741 return; 2758 return;
2742 } 2759 }
2743 showLayerTree(layoutObject->enclosingLayer()); 2760 showLayerTree(layoutObject->enclosingLayer());
2744 } 2761 }
2745 #endif 2762 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698