Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java

Issue 1357923002: wip Move SurfaceTexture.updateTexImage() from video renderers into MediaCodecVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java
diff --git a/talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java b/talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java
index cd8bfcb48c7b4ae623e94a24ecafe38bf096bbb7..766c56fc3c2ea6f4140e9f003767fcfdd7a7fe9a 100644
--- a/talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java
+++ b/talk/app/webrtc/androidtests/src/org/webrtc/RendererCommonTest.java
@@ -36,7 +36,7 @@ import android.graphics.Point;
import static org.webrtc.RendererCommon.ScalingType.*;
import static org.webrtc.RendererCommon.getDisplaySize;
import static org.webrtc.RendererCommon.getLayoutMatrix;
-import static org.webrtc.RendererCommon.getSamplingMatrix;
+import static org.webrtc.RendererCommon.rotateTextureMatrix;
public class RendererCommonTest extends ActivityTestCase {
@SmallTest
@@ -149,27 +149,40 @@ public class RendererCommonTest extends ActivityTestCase {
}
@SmallTest
- static public void testSamplingMatrixDefault() {
- final float samplingMatrix[] = getSamplingMatrix(null, 0);
+ static public void testRotateTextureMatrixDefault() {
+ // Test that rotation with 0 degrees returns an identical matrix.
+ final float[] matrix = new float[] {
+ 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 0, 1, 2,
+ 3, 4, 5, 6
+ };
+ final float rotatedMatrix[] = rotateTextureMatrix(matrix, 0);
+ MoreAsserts.assertEquals(round(rotatedMatrix), round(matrix));
+ }
+
+ @SmallTest
+ static public void testRotateTextureMatrix90Deg() {
+ final float samplingMatrix[] = rotateTextureMatrix(RendererCommon.IDENTITY_MATRIX, 90);
// Assert:
- // u' = u.
- // v' = 1 - v.
+ // u' = 1 - v.
+ // v' = u.
MoreAsserts.assertEquals(round(samplingMatrix), new double[]
- {1, 0, 0, 0,
- 0, -1, 0, 0,
- 0, 0, 1, 0,
- 0, 1, 0, 1});
+ { 0, 1, 0, 0,
+ -1, 0, 0, 0,
+ 0, 0, 1, 0,
+ 1, 0, 0, 1});
}
@SmallTest
- static public void testSamplingMatrixRotation90Deg() {
- final float samplingMatrix[] = getSamplingMatrix(null, 90);
+ static public void testRotateTextureMatrix180Deg() {
+ final float samplingMatrix[] = rotateTextureMatrix(RendererCommon.IDENTITY_MATRIX, 180);
// Assert:
// u' = 1 - u.
// v' = 1 - v.
MoreAsserts.assertEquals(round(samplingMatrix), new double[]
- { 0, -1, 0, 0,
- -1, 0, 0, 0,
+ {-1, 0, 0, 0,
+ 0, -1, 0, 0,
0, 0, 1, 0,
1, 1, 0, 1});
}

Powered by Google App Engine
This is Rietveld 408576698