diff options
Diffstat (limited to 'Source/WebCore/rendering')
-rw-r--r-- | Source/WebCore/rendering/InlineTextBox.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderArena.cpp | 7 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderArena.h | 4 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderLayerCompositor.cpp | 14 | ||||
-rw-r--r-- | Source/WebCore/rendering/style/RenderStyle.h | 39 | ||||
-rw-r--r-- | Source/WebCore/rendering/style/StyleRareInheritedData.cpp | 34 | ||||
-rw-r--r-- | Source/WebCore/rendering/style/StyleRareInheritedData.h | 11 |
8 files changed, 17 insertions, 96 deletions
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp index 5815b8b..e8a9c7f 100644 --- a/Source/WebCore/rendering/InlineTextBox.cpp +++ b/Source/WebCore/rendering/InlineTextBox.cpp @@ -43,6 +43,7 @@ #include "Text.h" #include "break_lines.h" #include <wtf/AlwaysInline.h> +#include <wtf/text/CString.h> using namespace std; diff --git a/Source/WebCore/rendering/RenderArena.cpp b/Source/WebCore/rendering/RenderArena.cpp index 57ed978..e15101f 100644 --- a/Source/WebCore/rendering/RenderArena.cpp +++ b/Source/WebCore/rendering/RenderArena.cpp @@ -136,11 +136,4 @@ void RenderArena::free(size_t size, void* ptr) #endif } -#ifdef ANDROID_INSTRUMENT -size_t RenderArena::reportPoolSize() const -{ - return ReportPoolSize(&m_pool); -} -#endif - } // namespace WebCore diff --git a/Source/WebCore/rendering/RenderArena.h b/Source/WebCore/rendering/RenderArena.h index 5d2559a..e1ff535 100644 --- a/Source/WebCore/rendering/RenderArena.h +++ b/Source/WebCore/rendering/RenderArena.h @@ -53,10 +53,6 @@ public: void* allocate(size_t); void free(size_t, void*); -#ifdef ANDROID_INSTRUMENT - size_t reportPoolSize() const; -#endif - private: // Underlying arena pool ArenaPool m_pool; diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index cdc4c05..0932224 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -64,6 +64,7 @@ #include "HTMLNames.h" #if ENABLE(ANDROID_OVERFLOW_SCROLL) #include "HTMLTextAreaElement.h" +#include "GraphicsLayerAndroid.h" #endif #include "HitTestRequest.h" #include "HitTestResult.h" @@ -1424,6 +1425,8 @@ void RenderLayer::scrollTo(int x, int y) // do not need to repaint simply because we are scrolling if (view && !hasOverflowScroll()) renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); + if (view && hasOverflowScroll() && backing() && backing()->graphicsLayer()) + static_cast<GraphicsLayerAndroid*>(backing()->graphicsLayer())->updateScrollOffset(); #else if (view) renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp index 33bf2f7..03f1e41 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp @@ -92,6 +92,10 @@ struct CompositingState { RenderLayer* m_compositingAncestor; bool m_subtreeIsCompositing; + // m_compositingBounds is only used in computeCompositingRequirements. It can be either the + // ancestor bounds or the bounds for the sibling layers which are above the composited layer. + // It is used to reject creating unnecesary layers. + IntRect m_compositingBounds; #if ENABLE(COMPOSITED_FIXED_ELEMENTS) bool m_fixedSibling; bool m_hasFixedElement; @@ -693,7 +697,10 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O if (absBounds.isEmpty()) absBounds.setSize(IntSize(1, 1)); haveComputedBounds = true; - mustOverlapCompositedLayers = overlapsCompositedLayers(*overlapMap, absBounds); + // If the current subtree is not compositing, and the layer is fully inside the current compositing bounnds, + // there is no need to do the overlap test. This reduces the total number of the composited layers. + if (compositingState.m_subtreeIsCompositing || !compositingState.m_compositingBounds.contains(absBounds)) + mustOverlapCompositedLayers = overlapsCompositedLayers(*overlapMap, absBounds); } #if ENABLE(COMPOSITED_FIXED_ELEMENTS) @@ -709,6 +716,10 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O // a compositing layer among them, so start by inheriting the compositing // ancestor with m_subtreeIsCompositing set to false. CompositingState childState(compositingState.m_compositingAncestor); + if (compositingState.m_subtreeIsCompositing) + childState.m_compositingBounds = absBounds; + else + childState.m_compositingBounds = compositingState.m_compositingBounds; #ifndef NDEBUG ++childState.m_depth; #endif @@ -729,6 +740,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O compositingState.m_subtreeIsCompositing = true; // This layer now acts as the ancestor for kids. childState.m_compositingAncestor = layer; + childState.m_compositingBounds = absBounds; if (overlapMap) addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds); } diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index fad5a7b..ea01064 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -786,19 +786,6 @@ public: ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); } -#ifdef ANDROID_CSS_RING - // called when building nav cache to determine if the ring data is unchanged - const void* ringData() const { return reinterpret_cast<const void*>(rareInheritedData.get()); } - Color ringFillColor() const { return rareInheritedData->ringFillColor; } - Length ringInnerWidth() const { return rareInheritedData->ringInnerWidth; } - Length ringOuterWidth() const { return rareInheritedData->ringOuterWidth; } - Length ringOutset() const { return rareInheritedData->ringOutset; } - Color ringPressedInnerColor() const { return rareInheritedData->ringPressedInnerColor; } - Color ringPressedOuterColor() const { return rareInheritedData->ringPressedOuterColor; } - Length ringRadius() const { return rareInheritedData->ringRadius; } - Color ringSelectedInnerColor() const { return rareInheritedData->ringSelectedInnerColor; } - Color ringSelectedOuterColor() const { return rareInheritedData->ringSelectedOuterColor; } -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; } #endif @@ -1142,21 +1129,6 @@ public: void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); } void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); } -#ifdef ANDROID_CSS_RING - void setRingFillColor(const Color& v) { SET_VAR(rareInheritedData, ringFillColor, v); } - void setRingInnerWidth(Length v) { SET_VAR(rareInheritedData, ringInnerWidth, v); } - void setRingOuterWidth(Length v) { SET_VAR(rareInheritedData, ringOuterWidth, v); } - void setRingOutset(Length v) { SET_VAR(rareInheritedData, ringOutset, v); } - void setRingPressedInnerColor(const Color& v) { - SET_VAR(rareInheritedData, ringPressedInnerColor, v); } - void setRingPressedOuterColor(const Color& v) { - SET_VAR(rareInheritedData, ringPressedOuterColor, v); } - void setRingRadius(Length v) { SET_VAR(rareInheritedData, ringRadius, v); } - void setRingSelectedInnerColor(const Color& v) { - SET_VAR(rareInheritedData, ringSelectedInnerColor, v); } - void setRingSelectedOuterColor(const Color& v) { - SET_VAR(rareInheritedData, ringSelectedOuterColor, v); } -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR void setTapHighlightColor(const Color& v) { SET_VAR(rareInheritedData, tapHighlightColor, v); } #endif @@ -1359,17 +1331,6 @@ public: static const Vector<StyleDashboardRegion>& noneDashboardRegions(); #endif -#ifdef ANDROID_CSS_RING - static Color initialRingFillColor() { return Color::ringFill; } - static Length initialRingInnerWidth() { return Length(16, Fixed); } // 1.0 - static Length initialRingOuterWidth() { return Length(40, Fixed); } // 2.5 - static Length initialRingOutset() { return Length(3, Fixed); } - static Color initialRingSelectedInnerColor() { return Color::ringSelectedInner; } - static Color initialRingSelectedOuterColor() { return Color::ringSelectedOuter; } - static Color initialRingPressedInnerColor() { return Color::ringPressedInner; } - static Color initialRingPressedOuterColor() { return Color::ringPressedOuter; } - static Length initialRingRadius() { return Length(1, Fixed); } -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR static Color initialTapHighlightColor() { return Color::tap; } #endif diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp index 2253d1c..a7acc4a 100644 --- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -32,17 +32,6 @@ namespace WebCore { StyleRareInheritedData::StyleRareInheritedData() : textStrokeWidth(RenderStyle::initialTextStrokeWidth()) -#ifdef ANDROID_CSS_RING - , ringFillColor(RenderStyle::initialRingFillColor()) - , ringInnerWidth(RenderStyle::initialRingInnerWidth()) - , ringOuterWidth(RenderStyle::initialRingOuterWidth()) - , ringOutset(RenderStyle::initialRingOutset()) - , ringPressedInnerColor(RenderStyle::initialRingPressedInnerColor()) - , ringPressedOuterColor(RenderStyle::initialRingPressedOuterColor()) - , ringRadius(RenderStyle::initialRingRadius()) - , ringSelectedInnerColor(RenderStyle::initialRingSelectedInnerColor()) - , ringSelectedOuterColor(RenderStyle::initialRingSelectedOuterColor()) -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR , tapHighlightColor(RenderStyle::initialTapHighlightColor()) #endif @@ -77,18 +66,6 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o) , textStrokeColor(o.textStrokeColor) , textStrokeWidth(o.textStrokeWidth) , textFillColor(o.textFillColor) - , textEmphasisColor(o.textEmphasisColor) -#ifdef ANDROID_CSS_RING - , ringFillColor(o.ringFillColor) - , ringInnerWidth(o.ringInnerWidth) - , ringOuterWidth(o.ringOuterWidth) - , ringOutset(o.ringOutset) - , ringPressedInnerColor(o.ringPressedInnerColor) - , ringPressedOuterColor(o.ringPressedOuterColor) - , ringRadius(o.ringRadius) - , ringSelectedInnerColor(o.ringSelectedInnerColor) - , ringSelectedOuterColor(o.ringSelectedOuterColor) -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR , tapHighlightColor(o.tapHighlightColor) #endif @@ -157,17 +134,6 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && nbspMode == o.nbspMode && khtmlLineBreak == o.khtmlLineBreak && textSizeAdjust == o.textSizeAdjust -#ifdef ANDROID_CSS_RING - && ringFillColor == o.ringFillColor - && ringInnerWidth == o.ringInnerWidth - && ringOuterWidth == o.ringOuterWidth - && ringOutset == o.ringOutset - && ringPressedInnerColor == o.ringPressedInnerColor - && ringPressedOuterColor == o.ringPressedOuterColor - && ringRadius == o.ringRadius - && ringSelectedInnerColor == o.ringSelectedInnerColor - && ringSelectedOuterColor == o.ringSelectedOuterColor -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR && tapHighlightColor == o.tapHighlightColor #endif diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.h b/Source/WebCore/rendering/style/StyleRareInheritedData.h index 39cfe3c..16fcc5f 100644 --- a/Source/WebCore/rendering/style/StyleRareInheritedData.h +++ b/Source/WebCore/rendering/style/StyleRareInheritedData.h @@ -58,17 +58,6 @@ public: Color textFillColor; Color textEmphasisColor; -#ifdef ANDROID_CSS_RING - Color ringFillColor; - Length ringInnerWidth; - Length ringOuterWidth; - Length ringOutset; - Color ringPressedInnerColor; - Color ringPressedOuterColor; - Length ringRadius; - Color ringSelectedInnerColor; - Color ringSelectedOuterColor; -#endif #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR Color tapHighlightColor; #endif |