OSDN Git Service

make methods private (or static local) if possible to reduce surface area of API
authorMike Reed <reed@google.com>
Thu, 25 Feb 2010 22:07:06 +0000 (17:07 -0500)
committerMike Reed <reed@google.com>
Thu, 25 Feb 2010 22:07:06 +0000 (17:07 -0500)
WebCore/platform/graphics/android/LayerAndroid.cpp
WebCore/platform/graphics/android/LayerAndroid.h

index 0dedd64..9bd5a78 100644 (file)
@@ -197,11 +197,11 @@ void LayerAndroid::bounds(SkRect* rect) const
     rect->fBottom = rect->fTop + size.height();
 }
 
-bool LayerAndroid::boundsIsUnique(SkTDArray<SkRect>* region,
-                                  const SkRect& local) const
+static bool boundsIsUnique(const SkTDArray<SkRect>& region,
+                           const SkRect& local)
 {
-    for (int i = 0; i < region->count(); i++) {
-        if ((*region)[i].contains(local))
+    for (int i = 0; i < region.count(); i++) {
+        if (region[i].contains(local))
             return false;
     }
     return true;
@@ -223,7 +223,7 @@ void LayerAndroid::clipInner(SkTDArray<SkRect>* region,
     localBounds.intersect(local);
     if (localBounds.isEmpty())
         return;
-    if (m_recordingPicture && boundsIsUnique(region, localBounds))
+    if (m_recordingPicture && boundsIsUnique(*region, localBounds))
         *region->append() = localBounds;
     for (int i = 0; i < countChildren(); i++)
         getChild(i)->clipInner(region, m_haveClip ? localBounds : local);
index 4f8a5fe..940c4d6 100644 (file)
@@ -130,7 +130,6 @@ public:
      */
     void updatePositions(const SkRect& viewPort);
 
-    void bounds(SkRect* ) const;
     void clipArea(SkTDArray<SkRect>* region) const;
     const LayerAndroid* find(int x, int y) const;
     const LayerAndroid* findById(int uniqueID) const;
@@ -144,8 +143,8 @@ protected:
     virtual void onDraw(SkCanvas*, SkScalar opacity);
 
 private:
+    void bounds(SkRect* ) const;
     bool prepareContext(bool force = false);
-    bool boundsIsUnique(SkTDArray<SkRect>* region, const SkRect& local) const;
     void clipInner(SkTDArray<SkRect>* region, const SkRect& local) const;
 
     bool m_isRootLayer;