Skip to content

Commit d211b48

Browse files
Jamie GennisAndroid (Google) Code Review
authored andcommitted
Merge "SurfaceTexture: unhide setDefaultBufferSize" into ics-mr1
2 parents 911263d + 2aafe74 commit d211b48

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

api/current.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8797,6 +8797,7 @@ package android.graphics {
87978797
method public long getTimestamp();
87988798
method public void getTransformMatrix(float[]);
87998799
method public void release();
8800+
method public void setDefaultBufferSize(int, int);
88008801
method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener);
88018802
method public void updateTexImage();
88028803
}

graphics/java/android/graphics/SurfaceTexture.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,17 @@ public void setOnFrameAvailableListener(OnFrameAvailableListener l) {
130130
}
131131

132132
/**
133-
* Set the size of buffers returned by requestBuffers when a width and height
134-
* of zero is requested.
133+
* Set the default size of the image buffers. The image producer may override the buffer size,
134+
* in which case the producer-set buffer size will be used, not the default size set by this
135+
* method. Both video and camera based image producers do override the size. This method may
136+
* be used to set the image size when producing images with {@link android.graphics.Canvas} (via
137+
* {@link android.view.Surface#lockCanvas}), or OpenGL ES (via an EGLSurface).
135138
*
136-
* @hide Pending approval by API council.
139+
* The new default buffer size will take effect the next time the image producer requests a
140+
* buffer to fill. For {@link android.graphics.Canvas} this will be the next time {@link
141+
* android.view.Surface#lockCanvas} is called. For OpenGL ES, the EGLSurface should be
142+
* destroyed (via eglDestroySurface), made not-current (via eglMakeCurrent), and then recreated
143+
* (via eglCreateWindowSurface) to ensure that the new default size has taken effect.
137144
*/
138145
public void setDefaultBufferSize(int width, int height) {
139146
nativeSetDefaultBufferSize(width, height);

0 commit comments

Comments
 (0)