コード例 #1
0
 public void push(float[] rect) {
   if (mRects.size() >= mCapity) {
     RectPoolableCache rc = mRects.removeFirst();
     mRectsCachePool.release(rc);
   }
   RectPoolableCache rc = mRectsCachePool.acquire();
   if (rc != null) {
     rc.setRect(rect);
     mRects.add(rc);
   }
 }
コード例 #2
0
 private void clearCachePool() {
   DrawingCache item;
   while ((item = mCachePool.acquire()) != null) {
     item.destroy();
   }
 }