diff options
author | reed <reed@google.com> | 2014-12-22 11:58:30 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-22 11:58:30 -0800 |
commit | d990e2f14f14c36c3d0beb303dd0953c7aa1fcfa (patch) | |
tree | 28b10e1df0c6709bff31faff6a4535d4734c6693 /src/core | |
parent | 39edf7664f50b6c890b933b5bbed67a8735b349b (diff) |
add testing flag to ignore saveLayer bounds
BUG=skia:
Review URL: https://codereview.chromium.org/819123003
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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); |