diff options
author | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 12:47:53 +0000 |
---|---|---|
committer | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 12:47:53 +0000 |
commit | 5d3def58525605ef784d49c6bfe66e6af04baf82 (patch) | |
tree | baaabb66bebc141d6a5759a926bc42eb24bc1f9b /ui/gl | |
parent | 4780531a118c2c6e0d49c4edd8902369d13dc410 (diff) | |
download | chromium_src-5d3def58525605ef784d49c6bfe66e6af04baf82.zip chromium_src-5d3def58525605ef784d49c6bfe66e6af04baf82.tar.gz chromium_src-5d3def58525605ef784d49c6bfe66e6af04baf82.tar.bz2 |
[Android] Only pass positive dimensions to SurfaceTexture#setDefaultBufferSize
The Android framework throws an error when it's passed a 0 width
or height for the image buffer.
BUG=
Review URL: https://chromiumcodereview.appspot.com/13842026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r-- | ui/gl/android/surface_texture_bridge.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/gl/android/surface_texture_bridge.cc b/ui/gl/android/surface_texture_bridge.cc index 16a36c5..cd9d9e5 100644 --- a/ui/gl/android/surface_texture_bridge.cc +++ b/ui/gl/android/surface_texture_bridge.cc @@ -113,9 +113,14 @@ void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) { JNIEnv* env = AttachCurrentThread(); CHECK(env); - JNI_SurfaceTexture::Java_SurfaceTexture_setDefaultBufferSize( - env, j_surface_texture_.obj(), static_cast<jint>(width), - static_cast<jint>(height)); + if (width > 0 && height > 0) { + JNI_SurfaceTexture::Java_SurfaceTexture_setDefaultBufferSize( + env, j_surface_texture_.obj(), static_cast<jint>(width), + static_cast<jint>(height)); + } else { + LOG(WARNING) << "Not setting surface texture buffer size - " + "width or height is 0"; + } } void SurfaceTextureBridge::AttachToGLContext(int texture_id) { |