WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-71724-20120410113148.patch (text/plain), 5.03 KB, created by
David Barr
on 2012-04-09 18:31:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
David Barr
Created:
2012-04-09 18:31:50 PDT
Size:
5.03 KB
patch
obsolete
>Subversion Revision: 113639 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index aac5f1dc5af8112049c1170269bd513a1b4fd18e..0bc16d55b0581ac945da735e2b56e3ccb296c2d2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2012-04-09 David Barr <davidbarr@chromium.org> >+ >+ Optimize double border rendering to avoid transparency layers >+ https://bugs.webkit.org/show_bug.cgi?id=71724 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No functional change, painting optimization only. >+ >+ * rendering/RenderBoxModelObject.cpp: >+ (WebCore::RenderBoxModelObject::paintBorder): >+ > 2012-04-09 Dana Jansens <danakj@chromium.org> > > [chromium] Make culling work with clipped rects >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp >index 2e55e7f74924644977c633ee7e6eba4a5b9acae4..35e81b7b01f6153138d5ac5558d6c4e274d5ff47 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp >+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp >@@ -1794,6 +1794,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect& > > bool haveAlphaColor = false; > bool haveAllSolidEdges = true; >+ bool haveAllDoubleEdges = true; > bool allEdgesVisible = true; > bool allEdgesShareColor = true; > int firstVisibleEdge = -1; >@@ -1821,6 +1822,9 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect& > > if (currEdge.style != SOLID) > haveAllSolidEdges = false; >+ >+ if (currEdge.style != DOUBLE) >+ haveAllDoubleEdges = false; > } > > // If no corner intersects the clip region, we can pretend outerBorder is >@@ -1829,7 +1833,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect& > outerBorder.setRadii(RoundedRect::Radii()); > > // isRenderable() check avoids issue described in https://bugs.webkit.org/show_bug.cgi?id=38787 >- if (haveAllSolidEdges && allEdgesShareColor && innerBorder.isRenderable()) { >+ if ((haveAllSolidEdges || haveAllDoubleEdges) && allEdgesShareColor && innerBorder.isRenderable()) { > // Fast path for drawing all solid edges. > if (allEdgesVisible && (outerBorder.isRounded() || haveAlphaColor)) { > Path path; >@@ -1839,6 +1843,46 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect& > else > path.addRect(outerBorder.rect()); > >+ if (haveAllDoubleEdges) { >+ LayoutRect innerThirdRect = outerBorder.rect(); >+ LayoutRect outerThirdRect = outerBorder.rect(); >+ for (int side = BSTop; side <= BSLeft; ++side) { >+ int outerWidth; >+ int innerWidth; >+ edges[side].getDoubleBorderStripeWidths(outerWidth, innerWidth); >+ >+ if (side == BSTop) { >+ innerThirdRect.shiftYEdgeTo(innerThirdRect.y() + innerWidth); >+ outerThirdRect.shiftYEdgeTo(outerThirdRect.y() + outerWidth); >+ } else if (side == BSBottom) { >+ innerThirdRect.setHeight(innerThirdRect.height() - innerWidth); >+ outerThirdRect.setHeight(outerThirdRect.height() - outerWidth); >+ } else if (side == BSLeft) { >+ innerThirdRect.shiftXEdgeTo(innerThirdRect.x() + innerWidth); >+ outerThirdRect.shiftXEdgeTo(outerThirdRect.x() + outerWidth); >+ } else { >+ innerThirdRect.setWidth(innerThirdRect.width() - innerWidth); >+ outerThirdRect.setWidth(outerThirdRect.width() - outerWidth); >+ } >+ } >+ >+ RoundedRect outerThird = outerBorder; >+ RoundedRect innerThird = innerBorder; >+ innerThird.setRect(innerThirdRect); >+ outerThird.setRect(outerThirdRect); >+ outerThird.setRadii(innerThird.radii()); >+ >+ if (outerThird.isRounded() && bleedAvoidance != BackgroundBleedUseTransparencyLayer) >+ path.addRoundedRect(outerThird); >+ else >+ path.addRect(outerThird.rect()); >+ >+ if (innerThird.isRounded() && bleedAvoidance != BackgroundBleedUseTransparencyLayer) >+ path.addRoundedRect(innerThird); >+ else >+ path.addRect(innerThird.rect()); >+ } >+ > if (innerBorder.isRounded()) > path.addRoundedRect(innerBorder); > else >@@ -1850,7 +1894,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect& > return; > } > // Avoid creating transparent layers >- if (!allEdgesVisible && !outerBorder.isRounded() && haveAlphaColor) { >+ if (haveAllSolidEdges && !allEdgesVisible && !outerBorder.isRounded() && haveAlphaColor) { > Path path; > > for (int i = BSTop; i <= BSLeft; ++i) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
webkit.review.bot
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 71724
:
114203
|
117837
|
120241
|
121378
| 136362 |
136405