add SkPictureUtils::GatherPixelRefs()
Review URL: https://codereview.appspot.com/6845106
git-svn-id: http://skia.googlecode.com/svn/trunk@6615 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/utils/SkPictureUtils.h b/include/utils/SkPictureUtils.h
new file mode 100644
index 0000000..56318cd
--- /dev/null
+++ b/include/utils/SkPictureUtils.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPictureUtils_DEFINED
+#define SkPictureUtils_DEFINED
+
+#include "SkPicture.h"
+
+class SkData;
+struct SkRect;
+
+class SkPictureUtils {
+public:
+ /**
+ * Given a rectangular visible "window" into the picture, return an array
+ * of SkPixelRefs that might intersect that area. To keep the call fast,
+ * the returned list is not guaranteed to be exact, so it may miss some,
+ * and it may return false positives.
+ *
+ * The pixelrefs returned in the SkData are already owned by the picture,
+ * so the returned pointers are only valid while the picture is in scope
+ * and remains unchanged.
+ */
+ static SkData* GatherPixelRefs(SkPicture* pict, const SkRect& area);
+};
+
+#endif