|
45 | 45 | import android.os.PowerManager; |
46 | 46 | import android.content.pm.PackageManager; |
47 | 47 | import android.content.pm.ApplicationInfo; |
| 48 | +import android.graphics.PixelFormat; |
48 | 49 |
|
49 | 50 | import java.io.IOException; |
50 | 51 | import java.io.InputStream; |
@@ -594,11 +595,23 @@ public void run() { |
594 | 595 | try { |
595 | 596 | if (configToTest == 0) { |
596 | 597 | Log.i(TAG, "Try to use graphics config R8G8B8A8S8"); |
597 | | - ConfigChooser chooser = new ConfigChooser(8, 8, 8, 8, 0, 8); |
| 598 | + ConfigChooser chooser = new ConfigChooser( |
| 599 | + // rgba |
| 600 | + 8, 8, 8, 8, |
| 601 | + // depth |
| 602 | + mActivity.mInfo.metaData.getInt("surface:depth", 0), |
| 603 | + // stencil |
| 604 | + mActivity.mInfo.metaData.getInt("surface:stencil", 8)); |
598 | 605 | mEglConfig = chooser.chooseConfig(mEgl, mEglDisplay); |
599 | 606 | } else if (configToTest == 1) { |
600 | 607 | Log.i(TAG, "Try to use graphics config R5G6B5S8"); |
601 | | - ConfigChooser chooser = new ConfigChooser(5, 6, 5, 0, 0, 8); |
| 608 | + ConfigChooser chooser = new ConfigChooser( |
| 609 | + // rgba |
| 610 | + 5, 6, 5, 0, |
| 611 | + // depth |
| 612 | + mActivity.mInfo.metaData.getInt("surface:depth", 0), |
| 613 | + // stencil |
| 614 | + mActivity.mInfo.metaData.getInt("surface:stencil", 8)); |
602 | 615 | mEglConfig = chooser.chooseConfig(mEgl, mEglDisplay); |
603 | 616 | } else { |
604 | 617 | Log.e(TAG, "Unable to find a correct surface for this device !"); |
@@ -637,6 +650,9 @@ public void run() { |
637 | 650 | Log.w(TAG, "Done"); |
638 | 651 | waitForStart(); |
639 | 652 |
|
| 653 | + if ( mActivity.mInfo.metaData.getBoolean("surface:transluent") ) |
| 654 | + getHolder().setFormat(PixelFormat.TRANSLUCENT); |
| 655 | + |
640 | 656 | nativeResize(mWidth, mHeight); |
641 | 657 | nativeInitJavaCallbacks(); |
642 | 658 | nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory); |
|
0 commit comments