Index: Source/platform/graphics/GraphicsContext.cpp |
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp |
index f4691ddf85cd5bb21342d48c83abaa746c5151dc..caad0a46e7b485d61540bd4ebb8b8832fecb3f45 100644 |
--- a/Source/platform/graphics/GraphicsContext.cpp |
+++ b/Source/platform/graphics/GraphicsContext.cpp |
@@ -179,20 +179,14 @@ void GraphicsContext::restore() |
m_canvas->restoreToCount(savedState.m_restoreCount); |
} |
-void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCanvas::SaveFlags saveFlags) |
+void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint) |
{ |
if (paintingDisabled()) |
return; |
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); |
+ m_canvas->saveLayer(bounds, paint); |
if (m_trackOpaqueRegion) |
m_opaqueRegion.pushCanvasLayer(paint); |
} |
@@ -455,32 +449,17 @@ void GraphicsContext::beginLayer(float opacity, CompositeOperator op, const Floa |
if (paintingDisabled()) |
return; |
- // We need the "alpha" layer flag here because the base layer is opaque |
- // (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::kMatrixClip_SaveFlag | SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag); |
- |
SkPaint layerPaint; |
layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255)); |
layerPaint.setXfermode(WebCoreCompositeToSkiaComposite(op, m_paintState->blendMode()).get()); |
layerPaint.setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter).get()); |
layerPaint.setImageFilter(imageFilter); |
- // Filters will adjust the clip to accomodate for filter bounds, but |
- // need the kClipToLayer_SaveFlag to do so. We also save the clip here, so |
- // it is restored back before the filtered layer is drawn in restore(). |
- // The matrix also needs to be saved, in order to be correctly passed to |
- // the filter CTM during restore(). |
- if (imageFilter) |
- saveFlags = SkCanvas::kARGB_ClipLayer_SaveFlag; |
- |
if (bounds) { |
SkRect skBounds = WebCoreFloatRectToSKRect(*bounds); |
- saveLayer(&skBounds, &layerPaint, saveFlags); |
+ saveLayer(&skBounds, &layerPaint); |
} else { |
- saveLayer(0, &layerPaint, saveFlags); |
+ saveLayer(0, &layerPaint); |
} |
#if !ASSERT_DISABLED |