Changeset 98596 in webkit
- Timestamp:
- Oct 27, 2011, 10:19:28 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/chromium/test_expectations.txt (modified) (6 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp (modified) (6 diffs)
-
Source/WebCore/platform/graphics/skia/PlatformContextSkia.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98595 r98596 1 2011-10-27 Mike Reed <reed@google.com> 2 3 [skia] replace offscreen technique with native support for antialiased clipping 4 https://bugs.webkit.org/show_bug.cgi?id=70748 5 6 Reviewed by Stephen White. 7 8 ~100 layout tests need to be rebaselined, as the native aa-clipping differs sometimes in the low 9 bits of the result. Other than that, the results should be the same, except that now the drawing 10 can go directly to the canvas, rather than being direct offscreen and then have that result 11 "clipped" during the restore. This has the effect of allowing LCD text to be drawing inside a 12 antialiased clip area. 13 14 * platform/chromium/test_expectations.txt: 15 1 16 2011-10-27 Leandro Pereira <leandro@profusion.mobi> 2 17 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r98577 r98596 997 997 BUGWK64876 LINUX WIN GPU : fast/canvas/canvas-scale-strokePath-shadow.html = TEXT 998 998 999 1000 // Rebaseline once native aa-clipping has landed 1001 BUGWK70748 CPU : css2.1/t0805-c5517-brdr-s-00-c.html = IMAGE 1002 BUGWK70748 CPU : fast/backgrounds/border-radius-split-background-image.html = IMAGE 1003 BUGWK70748 CPU : fast/backgrounds/gradient-background-leakage.html = IMAGE 1004 BUGWK70748 CPU : fast/borders/borderRadiusAllStylesAllCorners.html = IMAGE 1005 BUGWK70748 CPU : fast/borders/borderRadiusArcs01.html = IMAGE 1006 BUGWK70748 CPU : fast/borders/border-radius-complex-inner.html = IMAGE 1007 BUGWK70748 CPU : fast/borders/borderRadiusDashed01.html = IMAGE 1008 BUGWK70748 CPU : fast/borders/borderRadiusDashed02.html = IMAGE 1009 BUGWK70748 CPU : fast/borders/borderRadiusDashed03.html = IMAGE 1010 BUGWK70748 CPU : fast/borders/borderRadiusDashed04.html = IMAGE 1011 BUGWK70748 CPU : fast/borders/borderRadiusDashed05.html = IMAGE 1012 BUGWK70748 CPU : fast/borders/border-radius-different-width-001.html = IMAGE 1013 BUGWK70748 CPU : fast/borders/borderRadiusDotted01.html = IMAGE 1014 BUGWK70748 CPU : fast/borders/borderRadiusDotted02.html = IMAGE 1015 BUGWK70748 CPU : fast/borders/borderRadiusDotted03.html = IMAGE 1016 BUGWK70748 CPU : fast/borders/borderRadiusDotted04.html = IMAGE 1017 BUGWK70748 CPU : fast/borders/borderRadiusDotted05.html = IMAGE 1018 BUGWK70748 CPU : fast/borders/borderRadiusDotted06.html = IMAGE 1019 BUGWK70748 CPU : fast/borders/borderRadiusDouble01.html = IMAGE 1020 BUGWK70748 CPU : fast/borders/borderRadiusDouble02.html = IMAGE 1021 BUGWK70748 CPU : fast/borders/borderRadiusDouble03.html = IMAGE 1022 BUGWK70748 CPU : fast/borders/borderRadiusDouble04.html = IMAGE 1023 BUGWK70748 CPU : fast/borders/borderRadiusDouble05.html = IMAGE 1024 BUGWK70748 CPU : fast/borders/borderRadiusDouble06.html = IMAGE 1025 BUGWK70748 CPU : fast/borders/borderRadiusDouble07.html = IMAGE 1026 BUGWK70748 CPU : fast/borders/borderRadiusDouble08.html = IMAGE 1027 BUGWK70748 CPU : fast/borders/borderRadiusDouble09.html = IMAGE 1028 BUGWK70748 CPU : fast/borders/border-radius-groove-01.html = IMAGE 1029 BUGWK70748 CPU : fast/borders/borderRadiusGroove01.html = IMAGE 1030 BUGWK70748 CPU : fast/borders/border-radius-groove-02.html = IMAGE 1031 BUGWK70748 CPU : fast/borders/borderRadiusGroove02.html = IMAGE 1032 BUGWK70748 CPU : fast/borders/border-radius-groove-03.html = IMAGE 1033 BUGWK70748 CPU : fast/borders/borderRadiusInset01.html = IMAGE 1034 BUGWK70748 CPU : fast/borders/border-radius-inset-outset.html = IMAGE 1035 BUGWK70748 CPU : fast/borders/borderRadiusOutset01.html = IMAGE 1036 BUGWK70748 CPU : fast/borders/borderRadiusRidge01.html = IMAGE 1037 BUGWK70748 CPU : fast/borders/border-radius-split-inline.html = IMAGE 1038 BUGWK70748 CPU : fast/borders/border-radius-wide-border-01.html = IMAGE 1039 BUGWK70748 CPU : fast/borders/border-radius-wide-border-02.html = IMAGE 1040 BUGWK70748 CPU : fast/borders/border-radius-wide-border-03.html = IMAGE 1041 BUGWK70748 CPU : fast/borders/border-radius-wide-border-04.html = IMAGE 1042 BUGWK70748 CPU : fast/borders/border-styles-split.html = IMAGE 1043 BUGWK70748 CPU : fast/borders/different-color-borders.html = IMAGE 1044 BUGWK70748 CPU : fast/borders/fieldsetBorderRadius.html = IMAGE 1045 BUGWK70748 CPU : fast/borders/mixed-border-styles-radius2.html = IMAGE 1046 BUGWK70748 CPU : fast/borders/mixed-border-styles-radius.html = IMAGE 1047 BUGWK70748 CPU : fast/box-shadow/basic-shadows.html = IMAGE 1048 BUGWK70748 CPU : fast/box-shadow/border-radius-big.html = IMAGE 1049 BUGWK70748 CPU : fast/box-shadow/inset-box-shadows.html = IMAGE 1050 BUGWK70748 CPU : fast/box-shadow/inset.html = IMAGE 1051 BUGWK70748 CPU : fast/box-shadow/inset-with-extraordinary-radii-and-border.html = IMAGE 1052 BUGWK70748 CPU : fast/box-shadow/spread.html = IMAGE 1053 BUGWK70748 CPU : fast/box-shadow/spread-multiple-inset.html = IMAGE 1054 BUGWK70748 CPU : fast/box-shadow/spread-multiple-normal.html = IMAGE 1055 BUGWK70748 CPU : fast/clip/overflow-border-radius-clip.html = IMAGE 1056 BUGWK70748 CPU : fast/css/box-shadow-and-border-radius.html = IMAGE 1057 BUGWK70748 CPU : fast/css/nested-rounded-corners.html = IMAGE 1058 BUGWK70748 CPU : fast/css/text-input-with-webkit-border-radius.html = IMAGE 1059 BUGWK70748 CPU : fast/forms/basic-selects.html = IMAGE 1060 BUGWK70748 CPU : fast/forms/validation-message-appearance.html = IMAGE 1061 BUGWK70748 CPU : fast/layers/video-layer.html = IMAGE 1062 BUGWK70748 CPU : fast/repaint/shadow-multiple-horizontal.html = IMAGE 1063 BUGWK70748 CPU : fast/repaint/shadow-multiple-strict-horizontal.html = IMAGE 1064 BUGWK70748 CPU : fast/repaint/shadow-multiple-strict-vertical.html = IMAGE 1065 BUGWK70748 CPU : fast/repaint/shadow-multiple-vertical.html = IMAGE 1066 BUGWK70748 CPU : fast/transforms/shadows.html = IMAGE 1067 BUGWK70748 CPU : fast/writing-mode/border-styles-vertical-lr.html = IMAGE 1068 BUGWK70748 CPU : fast/writing-mode/border-styles-vertical-rl.html = IMAGE 1069 BUGWK70748 CPU : fast/writing-mode/box-shadow-horizontal-bt.html = IMAGE 1070 BUGWK70748 CPU : fast/writing-mode/box-shadow-vertical-lr.html = IMAGE 1071 BUGWK70748 CPU : fast/writing-mode/box-shadow-vertical-rl.html = IMAGE 1072 BUGWK70748 CPU : fullscreen/full-screen-stacking-context.html = IMAGE 1073 BUGWK70748 CPU : media/audio-controls-rendering.html = IMAGE 1074 BUGWK70748 CPU : media/controls-after-reload.html = IMAGE 1075 BUGWK70748 CPU : media/controls-strict.html = IMAGE 1076 BUGWK70748 CPU : media/controls-styling.html = IMAGE 1077 BUGWK70748 CPU : media/controls-without-preload.html = IMAGE 1078 BUGWK70748 CPU : media/media-controls-clone.html = IMAGE 1079 BUGWK70748 CPU : media/media-document-audio-repaint.html = IMAGE 1080 BUGWK70748 CPU : media/video-controls-rendering.html = IMAGE 1081 BUGWK70748 CPU : media/video-display-toggle.html = IMAGE 1082 BUGWK70748 CPU : media/video-empty-source.html = IMAGE 1083 BUGWK70748 CPU : media/video-no-audio.html = IMAGE 1084 BUGWK70748 CPU : media/video-playing-and-pause.html = IMAGE 1085 BUGWK70748 CPU : media/video-volume-slider.html = IMAGE 1086 BUGWK70748 CPU : svg/clip-path/clip-in-mask-objectBoundingBox.svg = IMAGE 1087 BUGWK70748 CPU : svg/clip-path/clip-in-mask-userSpaceOnUse.svg = IMAGE 1088 BUGWK70748 CPU : svg/clip-path/clip-path-clipped-evenodd-twice.svg = IMAGE 1089 BUGWK70748 CPU : svg/clip-path/clip-path-clipped-nonzero.svg = IMAGE 1090 BUGWK70748 CPU : svg/clip-path/clip-path-clipped.svg = IMAGE 1091 BUGWK70748 CPU : svg/clip-path/clip-path-objectBoundingBox.svg = IMAGE 1092 BUGWK70748 CPU : svg/clip-path/clip-path-on-clipped-use.svg = IMAGE 1093 BUGWK70748 CPU : svg/clip-path/clip-path-on-g-and-child.svg = IMAGE 1094 BUGWK70748 CPU : svg/clip-path/clip-path-on-g.svg = IMAGE 1095 BUGWK70748 CPU : svg/clip-path/clip-path-on-svg-and-child.svg = IMAGE 1096 BUGWK70748 CPU : svg/clip-path/clip-path-on-svg.svg = IMAGE 1097 BUGWK70748 CPU : svg/clip-path/clip-path-transform-2.svg = IMAGE 1098 BUGWK70748 CPU : svg/clip-path/clip-path-use-as-child.svg = IMAGE 1099 BUGWK70748 CPU : svg/clip-path/clip-path-userSpaceOnUse.svg = IMAGE 1100 BUGWK70748 CPU : svg/clip-path/clip-path-with-text-clipped.svg = IMAGE 1101 BUGWK70748 CPU : svg/css/text-shadow-multiple.xhtml = IMAGE 1102 BUGWK70748 CPU : svg/custom/resource-invalidate-on-target-update.svg = IMAGE 1103 BUGWK70748 CPU : svg/custom/use-on-clip-path-with-transformation.svg = IMAGE 1104 BUGWK70748 CPU : svg/W3C-I18N/tspan-dirLTR-ubOverride-in-rtl-context.svg = IMAGE 1105 BUGWK70748 CPU : svg/W3C-SVG-1.1/painting-marker-02-f.svg = IMAGE 1106 BUGWK70748 CPU : fast/borders/only-one-border-with-width.html = IMAGE 1107 BUGWK70748 CPU : svg/W3C-SVG-1.1/masking-path-05-f.svg = IMAGE 999 1108 1000 1109 // ----------------------------------------------------------------- … … 1399 1508 // different results than with Skia. When we switch back to Skia, we can 1400 1509 // reenable these. 1401 BUGCR99500 WIN RELEASE : media/audio-repaint.html = IMAGE1402 1510 BUGCR99500 WIN : svg/as-background-image/animated-svg-as-background.html = IMAGE 1403 1511 BUGCR99500 WIN : svg/batik/text/textStyles.svg = IMAGE … … 2203 2311 2204 2312 // To be rebaselined when the new gdi-aa-text code finalizes 2205 BUGCR98248 WIN : fast/repaint/shadow-multiple-horizontal.html = IMAGE2206 BUGCR98248 WIN : fast/repaint/shadow-multiple-strict-horizontal.html = IMAGE2207 BUGCR98248 WIN : fast/repaint/shadow-multiple-strict-vertical.html = IMAGE2208 BUGCR98248 WIN : fast/repaint/shadow-multiple-vertical.html = IMAGE2209 2313 BUGCR98248 WIN : fast/text/stroking-decorations.html = IMAGE 2210 2314 BUGCR98248 WIN : fast/text/stroking.html = IMAGE 2211 BUGCR98248 WIN : fast/transforms/shadows.html = IMAGE2212 2315 BUGCR98248 WIN : fast/writing-mode/english-lr-text.html = IMAGE 2213 2316 BUGCR98248 WIN : svg/css/group-with-shadow.svg = IMAGE … … 2580 2683 BUGCR71022 LEOPARD : fast/text/justify-ideograph-vertical.html = IMAGE IMAGE+TEXT 2581 2684 2582 BUGCR71418 LEOPARD : fast/borders/border-radius-split-inline.html = IMAGE2685 BUGCR71418 LEOPARD CPU-CG : fast/borders/border-radius-split-inline.html = IMAGE 2583 2686 2584 2687 BUGWK53446 DEBUG : http/tests/navigation/forward-and-cancel.html = PASS CRASH TEXT … … 3002 3105 BUGWK60115 WIN : fast/text/shadow-translucent-fill.html = IMAGE 3003 3106 BUGWK60115 LEOPARD : fast/text/shadow-translucent-fill.html = IMAGE 3004 BUGWK60115 MAC : fast/transforms/shadows.html = PASS IMAGE3107 BUGWK60115 MAC CPU-CG : fast/transforms/shadows.html = PASS IMAGE 3005 3108 //BUGWK60115 XP : svg/css/group-with-shadow.svg = IMAGE 3006 3109 BUGWK60115 WIN : transitions/svg-text-shadow-transition.html = IMAGE … … 3671 3774 BUGWK68747 : media/controls-right-click-on-timebar.html = TIMEOUT PASS 3672 3775 3673 BUGCR96861 WIN DEBUG: media/audio-repaint.html = TIMEOUT IMAGE PASS3674 BUGCR97657 MAC CPU DEBUG : media/audio-repaint.html = TIMEOUT IMAGE PASS3776 BUGCR96861 WIN LINUX : media/audio-repaint.html = TIMEOUT IMAGE PASS 3777 BUGCR97657 MAC CPU-CG : media/audio-repaint.html = TIMEOUT IMAGE PASS 3675 3778 3676 3779 BUGWK68881 DEBUG : svg/text/selection-background-color.xhtml = CRASH IMAGE -
trunk/Source/WebCore/ChangeLog
r98594 r98596 1 2011-10-27 Mike Reed <reed@google.com> 2 3 [skia] replace offscreen technique with native support for antialiased clipping 4 https://bugs.webkit.org/show_bug.cgi?id=70748 5 6 Reviewed by Stephen White. 7 8 ~100 layout tests need to be rebaselined, as the native aa-clipping differs sometimes in the low 9 bits of the result. Other than that, the results should be the same, except that now the drawing 10 can go directly to the canvas, rather than being direct offscreen and then have that result 11 "clipped" during the restore. This has the effect of allowing LCD text to be drawing inside a 12 antialiased clip area. 13 14 * platform/graphics/skia/PlatformContextSkia.cpp: 15 (WebCore::PlatformContextSkia::State::State): 16 (WebCore::PlatformContextSkia::State::cloneInheritedProperties): 17 (WebCore::PlatformContextSkia::clipPathAntiAliased): 18 (WebCore::PlatformContextSkia::restore): 19 * platform/graphics/skia/PlatformContextSkia.h: 20 1 21 2011-10-27 Tony Chang <tony@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r98527 r98596 99 99 FloatRect m_clip; 100 100 101 // This is a list of clipping paths which are currently active, in the102 // order in which they were pushed.103 WTF::Vector<SkPath> m_antiAliasClipPaths;104 101 InterpolationQuality m_interpolationQuality; 105 102 … … 147 144 , m_imageBufferClip(other.m_imageBufferClip) 148 145 , m_clip(other.m_clip) 149 , m_antiAliasClipPaths(other.m_antiAliasClipPaths)150 146 , m_interpolationQuality(other.m_interpolationQuality) 151 147 { … … 164 160 PlatformContextSkia::State PlatformContextSkia::State::cloneInheritedProperties() 165 161 { 166 PlatformContextSkia::State state(*this); 167 168 // Everything is inherited except for the clip paths. 169 state.m_antiAliasClipPaths.clear(); 170 171 return state; 162 return PlatformContextSkia::State(*this); 172 163 } 173 164 … … 268 259 void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath) 269 260 { 270 if (m_canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability) { 271 // When the output is a vector device, like PDF, we don't need antialiased clips. 272 // It's up to the PDF rendering engine to do that. We can simply disable the 273 // antialiased clip code if the output is a vector device. 274 canvas()->clipPath(clipPath); 275 return; 276 } 277 278 // If we are currently tracking any anti-alias clip paths, then we already 279 // have a layer in place and don't need to add another. 280 bool haveLayerOutstanding = m_state->m_antiAliasClipPaths.size(); 281 282 // See comments in applyAntiAliasedClipPaths about how this works. 283 m_state->m_antiAliasClipPaths.append(clipPath); 284 285 if (!haveLayerOutstanding) { 286 SkRect bounds = clipPath.getBounds(); 287 // If we are doing a clip outside of clipPath our layer needs to be for the whole 288 // canvas, otherwise we can create a smaller layer. 289 SkRect* layerBounds = 0; 290 if (!clipPath.isInverseFillType()) 291 layerBounds = &bounds; 292 canvas()->saveLayerAlpha(layerBounds, 255, static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag | SkCanvas::kClipToLayer_SaveFlag)); 293 // Guards state modification during clipped operations. 294 // The state is popped in applyAntiAliasedClipPaths(). 295 canvas()->save(); 296 } 261 canvas()->clipPath(clipPath, SkRegion::kIntersect_Op, true); 297 262 } 298 263 … … 303 268 canvas()->restore(); 304 269 } 305 306 if (!m_state->m_antiAliasClipPaths.isEmpty())307 applyAntiAliasedClipPaths(m_state->m_antiAliasClipPaths);308 270 309 271 m_stateStack.removeLast(); … … 623 585 } 624 586 625 void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)626 {627 // Anti-aliased clipping:628 //629 // Skia's clipping is 1-bit only. Consider what would happen if it were 8-bit:630 // We have a square canvas, filled with white and we declare a circular631 // clipping path. Then we fill twice with a black rectangle. The fractional632 // pixels would first get the correct color (white * alpha + black * (1 -633 // alpha)), but the second fill would apply the alpha to the already634 // modified color and the result would be too dark.635 //636 // This, anti-aliased clipping needs to be performed after the drawing has637 // been done. In order to do this, we create a new layer of the canvas in638 // clipPathAntiAliased and store the clipping path. All drawing is done to639 // the layer's bitmap while it's in effect. When WebKit calls restore() to640 // undo the clipping, this function is called.641 //642 // Here, we walk the list of clipping paths backwards and, for each, we643 // clear outside of the clipping path. We only need a single extra layer644 // for any number of clipping paths.645 //646 // When we call restore on the SkCanvas, the layer's bitmap is composed647 // into the layer below and we end up with correct, anti-aliased clipping.648 649 m_canvas->restore();650 651 SkPaint paint;652 paint.setXfermodeMode(SkXfermode::kClear_Mode);653 paint.setAntiAlias(true);654 paint.setStyle(SkPaint::kFill_Style);655 656 for (size_t i = paths.size() - 1; i < paths.size(); --i) {657 paths[i].toggleInverseFillType();658 m_canvas->drawPath(paths[i], paint);659 }660 661 m_canvas->restore();662 }663 664 587 void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context) 665 588 { -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
r98527 r98596 186 186 // m_canvas that are also in imageBuffer. 187 187 void applyClipFromImage(const FloatRect&, const SkBitmap&); 188 void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);189 188 190 189 // common code between setupPaintFor[Filling,Stroking]
Note:
See TracChangeset
for help on using the changeset viewer.