Skip to content

Commit 7be1cdc

Browse files
committed
v1.4.1.3 fix some subtle crash
1 parent 14e1f46 commit 7be1cdc

File tree

11 files changed

+36
-25
lines changed

11 files changed

+36
-25
lines changed

README-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ allprojects {
4343
4444
// module build.gradle
4545
dependencies {
46-
implementation 'com.github.ChillingVan:android-openGL-canvas:v1.4.1.2'
46+
implementation 'com.github.ChillingVan:android-openGL-canvas:v1.4.1.3'
4747
}
4848
```
4949

@@ -129,6 +129,7 @@ It has sync and async modes.
129129
This is kind of heavy so I do not update call this for every drawn.
130130

131131
## Latest Update
132+
* Fix subtle crash issue
132133
* Add OrthoBitmapMatrix as One BitmapMatrix. Default BitmapMatrix uses perspective matrix.
133134
* Fix BitmapMatrix cut by small viewport issue when Bitmap out of screen.
134135
* Support cut bitmap with CropFilter

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ allprojects {
4848
4949
// module build.gradle
5050
dependencies {
51-
implementation 'com.github.ChillingVan:android-openGL-canvas:v1.4.1.2'
51+
implementation 'com.github.ChillingVan:android-openGL-canvas:v1.4.1.3'
5252
}
5353
```
5454

@@ -139,6 +139,7 @@ public class MyGLView extends GLView {
139139

140140

141141
## 最近更新
142+
* 修复潜在的IndexOutOfBound exception
142143
* 添加OrthoBitmapMatrix以支持正交投影。 默认BitmapMatrix用的是透视投影。
143144
* 修复BitmapMatrix被过小的viewport剪切的问题。支持更大的放大倍数及离屏距离。
144145
* 支持裁切图片的CropFilter

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ buildscript {
2727
google()
2828
}
2929
dependencies {
30-
classpath 'com.android.tools.build:gradle:3.1.3'
30+
classpath 'com.android.tools.build:gradle:3.4.0'
3131
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
3232
// NOTE: Do not place your application dependencies here; they belong
3333
// in the individual module build.gradle files

canvasgl/build.gradle

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
apply plugin: 'com.android.library'
2222
apply plugin: 'com.github.dcendents.android-maven'
2323
group='com.github.ChillingVan'
24+
def VERSION_NAME="1.4.1.3"
2425

2526
android {
26-
compileSdkVersion 27
27-
buildToolsVersion "27.0.3"
27+
compileSdkVersion 28
28+
buildToolsVersion "28.0.3"
2829
defaultConfig {
2930
minSdkVersion 14
30-
targetSdkVersion 27
31-
versionCode 104011
32-
versionName "1.4.1.2"
31+
targetSdkVersion 28
32+
versionCode 104013
33+
versionName VERSION_NAME
3334
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3435
}
3536
buildTypes {
@@ -79,3 +80,15 @@ artifacts {
7980
archives sourcesJar
8081
archives javadocJar
8182
}
83+
84+
/**
85+
* Used to support other project uses mavenLocal() to refer this project which is convenient to debug
86+
*/
87+
install {
88+
repositories.mavenInstaller {
89+
pom.version = 'v' + VERSION_NAME
90+
pom.artifactId = 'android-openGL-canvas'
91+
}
92+
}
93+
94+

canvasgl/src/main/java/com/chillingvan/canvasgl/glcanvas/BitmapTexture.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import android.graphics.Bitmap;
2424

25-
import junit.framework.Assert;
26-
2725
// BitmapTexture is a secondBitmap whose content is specified by a fixed Bitmap.
2826
//
2927
// The secondBitmap does not own the Bitmap. The user should make sure the Bitmap
@@ -38,7 +36,7 @@ public BitmapTexture(Bitmap bitmap) {
3836

3937
public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
4038
super(hasBorder);
41-
Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
39+
// Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
4240
mContentBitmap = bitmap;
4341
}
4442

canvasgl/src/main/java/com/chillingvan/canvasgl/glcanvas/GLPaint.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import android.graphics.Color;
2424
import android.graphics.Paint;
2525

26-
import junit.framework.Assert;
2726

2827
public class GLPaint {
2928
private float mLineWidth = 1f;
@@ -39,7 +38,6 @@ public int getColor() {
3938
}
4039

4140
public void setLineWidth(float width) {
42-
Assert.assertTrue(width >= 0);
4341
mLineWidth = width;
4442
}
4543

canvasgl/src/main/java/com/chillingvan/canvasgl/glcanvas/UploadedTexture.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import android.graphics.Bitmap.Config;
2525
import android.opengl.GLUtils;
2626

27-
import junit.framework.Assert;
28-
2927
import java.util.HashMap;
3028

3129
import javax.microedition.khronos.opengles.GL11;
@@ -148,7 +146,7 @@ private Bitmap getBitmap() {
148146
}
149147

150148
private void freeBitmap() {
151-
Assert.assertTrue(mBitmap != null);
149+
// Assert.assertTrue(mBitmap != null);
152150
onFreeBitmap(mBitmap);
153151
mBitmap = null;
154152
}
@@ -223,7 +221,7 @@ private void uploadToCanvas(GLCanvas canvas) {
223221
int texWidth = getTextureWidth();
224222
int texHeight = getTextureHeight();
225223

226-
Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
224+
// Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
227225

228226
// Upload the bitmap to a new secondBitmap.
229227
mId = canvas.getGLId().generateTexture();

canvasgl/src/main/java/com/chillingvan/canvasgl/glview/texture/GLMultiTexProducerView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@ public GLTexture addProducedGLTexture(int width, int height, boolean opaque, int
106106
@Override
107107
public void onSurfaceChanged(int width, int height) {
108108
super.onSurfaceChanged(width, height);
109-
Loggers.d(TAG, "onSurfaceChanged: ");
109+
Loggers.d(TAG, "onSurfaceChanged: " + width + ", " + height);
110110
if (producedTextureList.isEmpty()) {
111111
for (int i = 0; i < getInitialTexCount(); i++) {
112+
// This must be in this thread because it relies on the GLContext of this thread
112113
producedTextureList.add(GLTexture.createRaw(width, height, false, producedTextureTarget, mCanvas));
113114
}
114115
post(new Runnable() {
115116
@Override
116117
public void run() {
117-
if (surfaceTextureCreatedListener != null) {
118+
if (!producedTextureList.isEmpty() && surfaceTextureCreatedListener != null) {
118119
surfaceTextureCreatedListener.onCreated(producedTextureList);
119120
}
120121
}
@@ -139,6 +140,7 @@ public void onDrawFrame() {
139140
@Override
140141
public void onPause() {
141142
super.onPause();
143+
Loggers.d(TAG, "onPause");
142144
recycleProduceTexture();
143145
if (mGLThread == null) {
144146
Log.w(TAG, "!!!!!! You may not call setShareEglContext !!!");

canvasglsample/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
apply plugin: 'com.android.application'
2222

2323
android {
24-
compileSdkVersion 27
25-
buildToolsVersion '27.0.3'
24+
compileSdkVersion 28
25+
buildToolsVersion '28.0.3'
2626

2727
defaultConfig {
2828
applicationId "com.chillingvan.canvasglsample"
2929
minSdkVersion 15
30-
targetSdkVersion 27
30+
targetSdkVersion 28
3131
versionCode 5
3232
versionName "1.4"
3333

canvasglsample/src/main/res/layout/activity_multi_tex_off_screen.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:layout_centerHorizontal="true"
3333
android:layout_marginBottom="70dp"
3434
android:textColor="@android:color/black"
35-
android:text="touch empty area and do not cover the camera"
35+
android:text="touch the TOP empty area and do not cover the camera"
3636
android:textSize="15sp"
3737
/>
3838

0 commit comments

Comments
 (0)