aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gn/android_framework_defines.gni1
-rw-r--r--include/core/SkCanvas.h22
-rw-r--r--public.bzl1
-rw-r--r--tests/CanvasTest.cpp2
4 files changed, 16 insertions, 10 deletions
diff --git a/gn/android_framework_defines.gni b/gn/android_framework_defines.gni
index b693d2808d..30c0ffedd0 100644
--- a/gn/android_framework_defines.gni
+++ b/gn/android_framework_defines.gni
@@ -16,4 +16,5 @@ android_framework_defines = [
"SK_SUPPORT_LEGACY_SHADER_ISABITMAP",
"SK_SUPPORT_LEGACY_EMBOSSMASKFILTER",
"SK_SUPPORT_EXOTIC_CLIPOPS",
+ "SK_SUPPORT_LEGACY_CANVAS_GETCLIPSTACK",
]
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 909bbac718..47dd47b2c1 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -539,7 +539,6 @@ public:
*/
virtual bool getClipDeviceBounds(SkIRect* bounds) const;
-
/** Fill the entire canvas' bitmap (restricted to the current clip) with the
specified ARGB color, using the specified mode.
@param a the alpha component (0..255) of the color to fill the canvas
@@ -1289,15 +1288,6 @@ public:
*/
const SkMatrix& getTotalMatrix() const;
- /** Return the clip stack. The clip stack stores all the individual
- * clips organized by the save/restore frame in which they were
- * added.
- * @return the current clip stack ("list" of individual clip elements)
- */
- const SkClipStack* getClipStack() const {
- return fClipStack.get();
- }
-
typedef SkCanvasClipVisitor ClipVisitor;
/**
* Replays the clip operations, back to front, that have been applied to
@@ -1636,6 +1626,18 @@ private:
*/
bool canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint&);
+#ifdef SK_SUPPORT_LEGACY_CANVAS_GETCLIPSTACK
+public:
+#endif
+ /** Return the clip stack. The clip stack stores all the individual
+ * clips organized by the save/restore frame in which they were
+ * added.
+ * @return the current clip stack ("list" of individual clip elements)
+ */
+ const SkClipStack* getClipStack() const {
+ return fClipStack.get();
+ }
+private:
/**
* Keep track of the device clip bounds and if the matrix is scale-translate. This allows
diff --git a/public.bzl b/public.bzl
index 14d0c53bf8..307544a312 100644
--- a/public.bzl
+++ b/public.bzl
@@ -590,6 +590,7 @@ DEFINES_ALL = [
"SK_NO_ANALYTIC_AA",
"SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF",
"SK_SUPPORT_LEGACY_CLIPOP_EXOTIC_NAMES",
+ "SK_SUPPORT_LEGACY_CANVAS_GETCLIPSTACK",
]
################################################################################
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index bb34cb657c..0d2ac29505 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -188,6 +188,7 @@ private:
};
static void test_clipstack(skiatest::Reporter* reporter) {
+#ifdef SK_SUPPORT_LEGACY_CANVAS_GETCLIPSTACK
// The clipstack is refcounted, and needs to be able to out-live the canvas if a client has
// ref'd it.
const SkClipStack* cs = nullptr;
@@ -197,6 +198,7 @@ static void test_clipstack(skiatest::Reporter* reporter) {
}
REPORTER_ASSERT(reporter, cs->unique());
cs->unref();
+#endif
}
// Format strings that describe the test context. The %s token is where