From d990e2f14f14c36c3d0beb303dd0953c7aa1fcfa Mon Sep 17 00:00:00 2001 From: reed Date: Mon, 22 Dec 2014 11:58:30 -0800 Subject: add testing flag to ignore saveLayer bounds BUG=skia: Review URL: https://codereview.chromium.org/819123003 --- src/core/SkCanvas.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core') diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 751fabd666..c7fb2dd47f 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -34,6 +34,14 @@ #include "GrRenderTarget.h" #endif +static bool gIgnoreSaveLayerBounds; +void SkCanvas::Internal_Private_SetIgnoreSaveLayerBounds(bool ignore) { + gIgnoreSaveLayerBounds = ignore; +} +bool SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds() { + return gIgnoreSaveLayerBounds; +} + // experimental for faster tiled drawing... //#define SK_ENABLE_CLIP_QUICKREJECT @@ -909,6 +917,9 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveFlags flags, } int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { + if (gIgnoreSaveLayerBounds) { + bounds = NULL; + } SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag); fSaveCount += 1; this->internalSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag, false, strategy); @@ -916,6 +927,9 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { } int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags) { + if (gIgnoreSaveLayerBounds) { + bounds = NULL; + } SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, flags); fSaveCount += 1; this->internalSaveLayer(bounds, paint, flags, false, strategy); -- cgit v1.2.3