Java Code Examples for com.android.gallery3d.common.Utils#assertTrue()

The following examples show how to use com.android.gallery3d.common.Utils#assertTrue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TiledImageRenderer.java    From Trebuchet with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected Bitmap onGetBitmap() {
    Utils.assertTrue(mTileState == STATE_DECODED);

    // We need to override the width and height, so that we won't
    // draw beyond the boundaries.
    int rightEdge = ((mImageWidth - mX) >> mTileLevel);
    int bottomEdge = ((mImageHeight - mY) >> mTileLevel);
    setSize(Math.min(mTileSize, rightEdge), Math.min(mTileSize, bottomEdge));

    Bitmap bitmap = mDecodedTile;
    mDecodedTile = null;
    mTileState = STATE_ACTIVATED;
    return bitmap;
}
 
Example 2
Source File: TiledImageRenderer.java    From TurboLauncher with Apache License 2.0 5 votes vote down vote up
@Override
protected Bitmap onGetBitmap() {
    Utils.assertTrue(mTileState == STATE_DECODED);

    // We need to override the width and height, so that we won't
    // draw beyond the boundaries.
    int rightEdge = ((mImageWidth - mX) >> mTileLevel);
    int bottomEdge = ((mImageHeight - mY) >> mTileLevel);
    setSize(Math.min(mTileSize, rightEdge), Math.min(mTileSize, bottomEdge));

    Bitmap bitmap = mDecodedTile;
    mDecodedTile = null;
    mTileState = STATE_ACTIVATED;
    return bitmap;
}
 
Example 3
Source File: TiledImageRenderer.java    From LB-Launcher with Apache License 2.0 5 votes vote down vote up
@Override
protected Bitmap onGetBitmap() {
    Utils.assertTrue(mTileState == STATE_DECODED);

    // We need to override the width and height, so that we won't
    // draw beyond the boundaries.
    int rightEdge = ((mImageWidth - mX) >> mTileLevel);
    int bottomEdge = ((mImageHeight - mY) >> mTileLevel);
    setSize(Math.min(mTileSize, rightEdge), Math.min(mTileSize, bottomEdge));

    Bitmap bitmap = mDecodedTile;
    mDecodedTile = null;
    mTileState = STATE_ACTIVATED;
    return bitmap;
}
 
Example 4
Source File: BitmapTexture.java    From Trebuchet with GNU General Public License v3.0 4 votes vote down vote up
public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
    super(hasBorder);
    Utils.assertTrue(bitmap != null && !bitmap.isRecycled());
    mContentBitmap = bitmap;
}
 
Example 5
Source File: UploadedTexture.java    From Trebuchet with GNU General Public License v3.0 4 votes vote down vote up
private void freeBitmap() {
    Utils.assertTrue(mBitmap != null);
    onFreeBitmap(mBitmap);
    mBitmap = null;
}
 
Example 6
Source File: GLPaint.java    From Trebuchet with GNU General Public License v3.0 4 votes vote down vote up
public void setLineWidth(float width) {
    Utils.assertTrue(width >= 0);
    mLineWidth = width;
}