Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: src/core/SkCanvas.cpp

Issue 819123003: add testing flag to ignore saveLayer bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 751fabd6664ce9618244900d299b7860886cfa87..c7fb2dd47fd0889990e98192c04e06f8b5129b1d 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);
« no previous file with comments | « include/core/SkCanvas.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698