OSDN Git Service

Fix 5180429: Initialize native window transform to 0.
authorChih-Chung Chang <chihchung@google.com>
Thu, 25 Aug 2011 06:00:18 +0000 (14:00 +0800)
committerChih-Chung Chang <chihchung@google.com>
Thu, 25 Aug 2011 06:03:28 +0000 (14:03 +0800)
Change-Id: I2730895059d408fa731dc4ca8da3f7984fe196ae

libvideoeditor/lvpp/PreviewRenderer.cpp

index 63eceef..59ac712 100755 (executable)
@@ -49,25 +49,27 @@ PreviewRenderer::PreviewRenderer(
 
 int PreviewRenderer::init() {
     int err = 0;
+    ANativeWindow* anw = mSurface.get();
 
-    err = native_window_api_connect(mSurface.get(), NATIVE_WINDOW_API_CPU);
+    err = native_window_api_connect(anw, NATIVE_WINDOW_API_CPU);
     if (err) goto fail;
 
-    err = native_window_set_usage(mSurface.get(),
-            GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN);
+    err = native_window_set_usage(
+            anw, GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN);
     if (err) goto fail;
 
-    err = native_window_set_buffer_count(mSurface.get(), 3);
+    err = native_window_set_buffer_count(anw, 3);
     if (err) goto fail;
 
     err = native_window_set_scaling_mode(
-            mSurface.get(), NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+            anw, NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
     if (err) goto fail;
 
     err = native_window_set_buffers_geometry(
-            mSurface.get(),
-            mWidth, mHeight,
-            HAL_PIXEL_FORMAT_YV12);
+            anw, mWidth, mHeight, HAL_PIXEL_FORMAT_YV12);
+    if (err) goto fail;
+
+    err = native_window_set_buffers_transform(anw, 0);
     if (err) goto fail;
 
 fail: