Demote getCount, getDepth, and clear to RTree-only methods.

We use them only to test RTree.

BUG=skia:

Review URL: https://codereview.chromium.org/622773003
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 21c1d79..08d6bf4 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -24,7 +24,7 @@
 class RTreeBuildBench : public Benchmark {
 public:
     RTreeBuildBench(const char* name, MakeRectProc proc, bool bulkLoad,
-                    SkBBoxHierarchy* tree)
+                    SkRTree* tree)
         : fTree(tree)
         , fProc(proc)
         , fBulkLoad(bulkLoad) {
@@ -58,7 +58,7 @@
         }
     }
 private:
-    SkBBoxHierarchy* fTree;
+    SkRTree* fTree;
     MakeRectProc fProc;
     SkString fName;
     bool fBulkLoad;
@@ -76,7 +76,7 @@
     };
 
     RTreeQueryBench(const char* name, MakeRectProc proc, bool bulkLoad,
-                    QueryType q, SkBBoxHierarchy* tree)
+                    QueryType q, SkRTree* tree)
         : fTree(tree)
         , fProc(proc)
         , fBulkLoad(bulkLoad)
diff --git a/src/core/SkBBoxHierarchy.h b/src/core/SkBBoxHierarchy.h
index 53eabc8..3382ac1 100644
--- a/src/core/SkBBoxHierarchy.h
+++ b/src/core/SkBBoxHierarchy.h
@@ -44,23 +44,6 @@
      */
     virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const = 0;
 
-    virtual void clear() = 0;
-
-    /**
-     * Gets the number of insertions actually made (does not include deferred insertions)
-     */
-    virtual int getCount() const = 0;
-
-    /**
-     * Returns the depth of the currently allocated tree. The root node counts for 1 level,
-     * so it should be 1 or more if there's a root node. This information provides details
-     * about the underlying structure, which is useful mainly for testing purposes.
-     *
-     * Returns 0 if there are currently no nodes in the tree.
-     * Returns -1 if the structure isn't a tree.
-     */
-    virtual int getDepth() const = 0;
-
 private:
     typedef SkRefCnt INHERITED;
 };
diff --git a/src/core/SkRTree.h b/src/core/SkRTree.h
index 85469cc..0d88804 100644
--- a/src/core/SkRTree.h
+++ b/src/core/SkRTree.h
@@ -79,22 +79,14 @@
      */
     virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE;
 
-    virtual void clear() SK_OVERRIDE;
-    bool isEmpty() const { return 0 == fCount; }
-
-    /**
-     * Gets the depth of the tree structure
-     */
-    virtual int getDepth() const SK_OVERRIDE {
-        return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1;
-    }
-
-    /**
-     * This gets the insertion count (rather than the node count)
-     */
-    virtual int getCount() const SK_OVERRIDE { return fCount; }
+    void clear();
+    // Return the depth of the tree structure.
+    int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; }
+    // Insertion count (not overall node count, which may be greater).
+    int getCount() const { return fCount; }
 
 private:
+    bool isEmpty() const { return 0 == this->getCount(); }
 
     struct Node;
 
diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp
index 317d74a..ea51797 100644
--- a/src/core/SkTileGrid.cpp
+++ b/src/core/SkTileGrid.cpp
@@ -11,7 +11,6 @@
     : fXTiles(xTiles)
     , fYTiles(yTiles)
     , fInfo(info)
-    , fCount(0)
     , fTiles(SkNEW_ARRAY(SkTDArray<unsigned>, xTiles * yTiles)) {
     // Margin is offset by 1 as a provision for AA and
     // to cancel-out the outset applied by getClipDeviceBounds.
@@ -146,9 +145,3 @@
     }
 }
 
-void SkTileGrid::clear() {
-    for (int i = 0; i < fXTiles * fYTiles; i++) {
-        fTiles[i].reset();
-    }
-}
-
diff --git a/src/core/SkTileGrid.h b/src/core/SkTileGrid.h
index 97564c6..df0a746 100644
--- a/src/core/SkTileGrid.h
+++ b/src/core/SkTileGrid.h
@@ -38,19 +38,12 @@
      */
     virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE;
 
-    virtual void clear() SK_OVERRIDE;
-
-    virtual int getCount() const SK_OVERRIDE { return fCount; }
-
-    virtual int getDepth() const SK_OVERRIDE { return -1; }
-
     // For testing.
     int tileCount(int x, int y) { return fTiles[y * fXTiles + x].count(); }
 
 private:
     const int fXTiles, fYTiles;
     SkTileGridFactory::TileGridInfo fInfo;
-    size_t fCount;
 
     // (fXTiles * fYTiles) SkTDArrays, each listing ops overlapping that tile in order.
     SkTDArray<unsigned>* fTiles;
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 0518dd3..0d13a42 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1872,9 +1872,6 @@
     // All other methods unimplemented.
     virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_OVERRIDE {}
     virtual void flushDeferredInserts() SK_OVERRIDE {}
-    virtual void clear() SK_OVERRIDE {}
-    virtual int getCount() const SK_OVERRIDE { return 0; }
-    virtual int getDepth() const SK_OVERRIDE { return 0; }
 };
 
 class SpoonFedBBHFactory : public SkBBHFactory {
diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp
index ac3883b..ca75fc9 100644
--- a/tests/RecordDrawTest.cpp
+++ b/tests/RecordDrawTest.cpp
@@ -102,13 +102,9 @@
         Entry e = { opIndex, bounds };
         fEntries.push(e);
     }
-    virtual int getCount() const SK_OVERRIDE { return fEntries.count(); }
 
     virtual void flushDeferredInserts() SK_OVERRIDE {}
-
     virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {}
-    virtual void clear() SK_OVERRIDE {}
-    virtual int getDepth() const SK_OVERRIDE { return -1; }
 
     struct Entry {
         unsigned opIndex;