Commit bc34718c authored by fmalita@chromium.org's avatar fmalita@chromium.org

GC::saveLayer() may taint the current clip.

SaveLayer() can optionally apply a clip. In that case we need to make
sure that we're saving the current clip, to avoid tainting it.

This was discovered while experimenting with SaveFlags removal and
requires a minor test rebaseline.

R=schenney@chormium.org,senorblanco@chromium.org

Review URL: https://codereview.chromium.org/212993004

git-svn-id: svn://svn.chromium.org/blink/trunk@170096 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a3cbf633
......@@ -750,6 +750,8 @@ crbug.com/253763 fast/text-autosizing/first-line-scale-factor.html [ ImageOnlyFa
crbug.com/253763 fast/text-autosizing/pseudo-scale-factor.html [ ImageOnlyFailure ]
crbug.com/253763 virtual/fasttextautosizing/fast/text-autosizing/first-line-scale-factor.html [ ImageOnlyFailure ]
Bug(fmalita) svg/filters/filter-clip.svg [ NeedsRebaseline ]
# FIXME(crbug.com/302005): Remove these as expectations are updated or the fasttextautosizer improves.
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/cluster-inline-grid-flex-box.html [ ImageOnlyFailure ]
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/cluster-list-item.html [ ImageOnlyFailure ]
......
......@@ -186,6 +186,10 @@ void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCa
realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag);
// We should always save the matrix and clip to match upcoming Skia behavior.
ASSERT(saveFlags & SkCanvas::kMatrix_SaveFlag);
ASSERT(saveFlags & SkCanvas::kClip_SaveFlag);
m_canvas->saveLayer(bounds, paint, saveFlags);
if (bounds)
m_canvas->clipRect(*bounds);
......@@ -455,7 +459,8 @@ void GraphicsContext::beginLayer(float opacity, CompositeOperator op, const Floa
// (the surface of the page) but layers on top may have transparent parts.
// Without explicitly setting the alpha flag, the layer will inherit the
// opaque setting of the base and some things won't work properly.
SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(
SkCanvas::kMatrixClip_SaveFlag | SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
SkPaint layerPaint;
layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment