Lines Matching defs:tile

46      *  This is the tile state in the CPU side.
131 * If the source does not care about the tile size, it should use
146 * The tile returned by this method can be specified this way: Assuming
253 // 1. Decide the tile level we want to use for display.
254 // 2. Decide the tile levels we want to keep as texture (in addition to
264 // The tile levels we want to keep as texture is in the range
272 // We want to keep one more tile level as texture in addition to what
296 // If rotation is transient, don't update the tile.
306 // Recycle unused tiles: if the level of the active tile is outside the
310 Tile tile = mActiveTiles.valueAt(i);
311 int level = tile.mTileLevel;
313 || !range[level - fromLevel].contains(tile.mX, tile.mY)) {
317 recycleTile(tile);
342 Tile tile = mActiveTiles.valueAt(i);
343 recycleTile(tile);
355 // aligned to the tile boundary.
378 // align the rectangle to tile boundary
395 Tile tile = mRecycledQueue.pop();
396 while (tile != null) {
397 tile.recycle();
398 tile = mRecycledQueue.pop();
474 Tile tile = mActiveTiles.valueAt(i);
475 if (!tile.isContentValid()) {
476 queueForDecode(tile);
481 private void queueForDecode(Tile tile) {
483 if (tile.mTileState == STATE_ACTIVATED) {
484 tile.mTileState = STATE_IN_QUEUE;
485 if (mDecodeQueue.push(tile)) {
492 private void decodeTile(Tile tile) {
494 if (tile.mTileState != STATE_IN_QUEUE) {
497 tile.mTileState = STATE_DECODING;
499 boolean decodeComplete = tile.decode();
501 if (tile.mTileState == STATE_RECYCLING) {
502 tile.mTileState = STATE_RECYCLED;
503 if (tile.mDecodedTile != null) {
504 sTilePool.release(tile.mDecodedTile);
505 tile.mDecodedTile = null;
507 mRecycledQueue.push(tile);
510 tile.mTileState = decodeComplete ? STATE_DECODED : STATE_DECODE_FAIL;
514 mUploadQueue.push(tile);
521 Tile tile = mRecycledQueue.pop();
522 if (tile != null) {
523 tile.mTileState = STATE_ACTIVATED;
524 tile.update(x, y, level);
525 return tile;
531 private void recycleTile(Tile tile) {
533 if (tile.mTileState == STATE_DECODING) {
534 tile.mTileState = STATE_RECYCLING;
537 tile.mTileState = STATE_RECYCLED;
538 if (tile.mDecodedTile != null) {
539 sTilePool.release(tile.mDecodedTile);
540 tile.mDecodedTile = null;
542 mRecycledQueue.push(tile);
548 Tile tile = mActiveTiles.get(key);
549 if (tile != null) {
550 if (tile.mTileState == STATE_IN_QUEUE) {
551 tile.mTileState = STATE_ACTIVATED;
555 tile = obtainTile(x, y, level);
556 mActiveTiles.put(key, tile);
572 Tile tile = null;
575 tile = mUploadQueue.pop();
577 if (tile == null) {
580 if (!tile.isContentValid()) {
581 if (tile.mTileState == STATE_DECODED) {
582 tile.updateContent(canvas);
585 Log.w(TAG, "Tile in upload queue has invalid state: " + tile.mTileState);
589 if (tile != null) {
594 // Draw the tile to a square at canvas that locates at (x, y) and
603 Tile tile = getTile(tx, ty, level);
604 if (tile != null) {
605 if (!tile.isContentValid()) {
606 if (tile.mTileState == STATE_DECODED) {
609 tile.updateContent(canvas);
613 } else if (tile.mTileState != STATE_DECODE_FAIL){
615 queueForDecode(tile);
618 if (drawTile(tile, canvas, source, target)) {
633 Tile tile, GLCanvas canvas, RectF source, RectF target) {
635 if (tile.isContentValid()) {
636 canvas.drawTexture(tile, source, target);
640 // Parent can be divided to four quads and tile is one of the four.
641 Tile parent = tile.getParentTile();
645 if (tile.mX == parent.mX) {
652 if (tile.mY == parent.mY) {
659 tile = parent;
683 // Get a tile from the original image. The tile is down-scaled
692 Log.w(TAG, "fail to decode tile", t);
715 // size of the tile (which may be small because it is a tile at the
746 return String.format("tile(%s, %s, %s / %s)",
755 Tile tile = mHead;
756 if (tile != null) {
757 mHead = tile.mNext;
759 return tile;
762 public boolean push(Tile tile) {
763 if (contains(tile)) {
764 Log.w(TAG, "Attempting to add a tile already in the queue!");
768 tile.mNext = mHead;
769 mHead = tile;
773 private boolean contains(Tile tile) {
776 if (other == tile) {
803 Tile tile = mDecodeQueue.pop();
804 if (tile != null) {
805 return tile;
816 Tile tile = waitForTile();
817 decodeTile(tile);