Пример #1
0
  private void makeOpenglTexture(final Bitmap aBitmapARGB32) {
    myWidth = aBitmapARGB32.getWidth();
    myHeight = aBitmapARGB32.getHeight();

    myOglTextureId = myUtilities.makeNewOpenglTexture();
    myHasTextureIdFlag = true;

    myUtilities.setTexturePixels(aBitmapARGB32);
  }
Пример #2
0
  public final void makeUsing(final Bitmap aBitmap) {
    // #if DEBUG
    Assert.isFalse("not made", myHasTextureIdFlag);
    // #endif

    myWidth = aBitmap.getWidth();
    myHeight = aBitmap.getHeight();
    makeOpenglTexture(aBitmap);
  }
Пример #3
0
  private Bitmap makeProperBitmap(final Bitmap aBitmap, final int aWidth, final int aHeight) {
    final Bitmap bitmap = Bitmap.createBitmap(aWidth, aHeight, Bitmap.Config.ARGB_8888);
    myTextureCloneCanvas.setBitmap(bitmap);
    myTextureCloneCanvas.drawBitmap(aBitmap, 0, 0, myTextureClonePaint);

    // #if DEBUG
    Log.debug("created proper texture bitmap");
    Log.debug("bitmap size: {}x{}", aBitmap.getWidth(), aBitmap.getHeight());
    Log.debug("proper size: {}x{}", aWidth, aHeight);
    // #endif

    return bitmap;
  }