OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. | 1055 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. |
1056 DisableCompositingQueryAsserts disabler; | 1056 DisableCompositingQueryAsserts disabler; |
1057 | 1057 |
1058 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint
InvalidationCrossingFrameBoundaries()) | 1058 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint
InvalidationCrossingFrameBoundaries()) |
1059 container = compositingLayer->renderer(); | 1059 container = compositingLayer->renderer(); |
1060 return container; | 1060 return container; |
1061 } | 1061 } |
1062 | 1062 |
1063 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const | 1063 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const |
1064 { | 1064 { |
1065 // If we have a flow thread, then we need to do individual paint invalidatio
ns within the RenderRegions instead. | |
1066 // Return the flow thread as a paint invalidation container in order to crea
te a chokepoint that allows us to change | |
1067 // paint invalidation to do individual region paint invalidations. | |
1068 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock())
{ | |
1069 // If we have already found a paint invalidation container then we will
invalidate paints in that container only if it is part of the same | |
1070 // flow thread. Otherwise we will need to catch the paint invalidation c
all and send it to the flow thread. | |
1071 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea
dContainingBlock() != parentRenderFlowThread) | |
1072 paintInvalidationContainer = parentRenderFlowThread; | |
1073 } | |
1074 | |
1075 if (paintInvalidationContainer) | 1065 if (paintInvalidationContainer) |
1076 return paintInvalidationContainer; | 1066 return paintInvalidationContainer; |
1077 | 1067 |
1078 RenderView* renderView = view(); | 1068 RenderView* renderView = view(); |
1079 while (renderView->frame()->ownerRenderer()) | 1069 while (renderView->frame()->ownerRenderer()) |
1080 renderView = renderView->frame()->ownerRenderer()->view(); | 1070 renderView = renderView->frame()->ownerRenderer()->view(); |
1081 return renderView; | 1071 return renderView; |
1082 } | 1072 } |
1083 | 1073 |
1084 bool RenderObject::isPaintInvalidationContainer() const | 1074 bool RenderObject::isPaintInvalidationContainer() const |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 RELEASE_ASSERT(isRooted()); | 1122 RELEASE_ASSERT(isRooted()); |
1133 | 1123 |
1134 // FIXME: Unify "devtools.timeline.invalidationTracking" and "blink.invalida
tion". crbug.com/413527. | 1124 // FIXME: Unify "devtools.timeline.invalidationTracking" and "blink.invalida
tion". crbug.com/413527. |
1135 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidati
onTracking"), | 1125 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidati
onTracking"), |
1136 "PaintInvalidationTracking", | 1126 "PaintInvalidationTracking", |
1137 "data", InspectorPaintInvalidationTrackingEvent::data(this, paintInvalid
ationContainer)); | 1127 "data", InspectorPaintInvalidationTrackingEvent::data(this, paintInvalid
ationContainer)); |
1138 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintUsingContainer()", | 1128 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintUsingContainer()", |
1139 "object", this->debugName().ascii(), | 1129 "object", this->debugName().ascii(), |
1140 "info", jsonObjectForPaintInvalidationInfo(r, paintInvalidationReasonToS
tring(invalidationReason))); | 1130 "info", jsonObjectForPaintInvalidationInfo(r, paintInvalidationReasonToS
tring(invalidationReason))); |
1141 | 1131 |
1142 if (paintInvalidationContainer->isRenderFlowThread()) { | |
1143 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang
leInRegions(r); | |
1144 return; | |
1145 } | |
1146 | |
1147 if (paintInvalidationContainer->isRenderView()) { | 1132 if (paintInvalidationContainer->isRenderView()) { |
1148 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r,
invalidationReason); | 1133 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r,
invalidationReason); |
1149 return; | 1134 return; |
1150 } | 1135 } |
1151 | 1136 |
1152 if (paintInvalidationContainer->view()->usesCompositing()) { | 1137 if (paintInvalidationContainer->view()->usesCompositing()) { |
1153 ASSERT(paintInvalidationContainer->isPaintInvalidationContainer()); | 1138 ASSERT(paintInvalidationContainer->isPaintInvalidationContainer()); |
1154 paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r, in
validationReason); | 1139 paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r, in
validationReason); |
1155 } | 1140 } |
1156 } | 1141 } |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed, paintInvalidationState); | 2018 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed, paintInvalidationState); |
2034 transformState.flatten(); | 2019 transformState.flatten(); |
2035 | 2020 |
2036 return transformState.lastPlanarPoint(); | 2021 return transformState.lastPlanarPoint(); |
2037 } | 2022 } |
2038 | 2023 |
2039 FloatPoint RenderObject::localToInvalidationBackingPoint(const LayoutPoint& loca
lPoint, RenderLayer** backingLayer) | 2024 FloatPoint RenderObject::localToInvalidationBackingPoint(const LayoutPoint& loca
lPoint, RenderLayer** backingLayer) |
2040 { | 2025 { |
2041 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint
Invalidation(); | 2026 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint
Invalidation(); |
2042 ASSERT(paintInvalidationContainer); | 2027 ASSERT(paintInvalidationContainer); |
2043 RenderLayer* layer = paintInvalidationContainer->layer(); | 2028 ASSERT(paintInvalidationContainer->layer()); |
2044 ASSERT(layer); | 2029 ASSERT(paintInvalidationContainer->layer()->compositingState() != NotComposi
ted); |
2045 | 2030 |
2046 if (backingLayer) | 2031 if (backingLayer) |
2047 *backingLayer = layer; | 2032 *backingLayer = paintInvalidationContainer->layer(); |
2048 FloatPoint containerPoint = localToContainerPoint(FloatPoint(localPoint), pa
intInvalidationContainer, TraverseDocumentBoundaries); | 2033 FloatPoint containerPoint = localToContainerPoint(FloatPoint(localPoint), pa
intInvalidationContainer, TraverseDocumentBoundaries); |
2049 | |
2050 if (layer->compositingState() == NotComposited) // This can happen for Rende
rFlowThread. | |
2051 return containerPoint; | |
2052 | |
2053 RenderLayer::mapPointToPaintBackingCoordinates(paintInvalidationContainer, c
ontainerPoint); | 2034 RenderLayer::mapPointToPaintBackingCoordinates(paintInvalidationContainer, c
ontainerPoint); |
2054 return containerPoint; | 2035 return containerPoint; |
2055 } | 2036 } |
2056 | 2037 |
2057 | |
2058 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const | 2038 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const |
2059 { | 2039 { |
2060 ASSERT(o == container()); | 2040 ASSERT(o == container()); |
2061 | 2041 |
2062 LayoutSize offset = o->columnOffset(point); | 2042 LayoutSize offset = o->columnOffset(point); |
2063 | 2043 |
2064 if (o->hasOverflowClip()) | 2044 if (o->hasOverflowClip()) |
2065 offset -= toRenderBox(o)->scrolledContentOffset(); | 2045 offset -= toRenderBox(o)->scrolledContentOffset(); |
2066 | 2046 |
2067 if (offsetDependsOnPoint) | 2047 if (offsetDependsOnPoint) |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 { | 3117 { |
3138 if (object1) { | 3118 if (object1) { |
3139 const blink::RenderObject* root = object1; | 3119 const blink::RenderObject* root = object1; |
3140 while (root->parent()) | 3120 while (root->parent()) |
3141 root = root->parent(); | 3121 root = root->parent(); |
3142 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3122 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3143 } | 3123 } |
3144 } | 3124 } |
3145 | 3125 |
3146 #endif | 3126 #endif |
OLD | NEW |