From f777aec04758456c96b581aeaf5dabc47e123626 Mon Sep 17 00:00:00 2001 From: Fei Zhang Date: Wed, 31 Jul 2013 14:04:29 +0800 Subject: Camera: fix gfx undefined buffer issue clear the render target before drawing, fix the undefined buffer mess up issue of preview layer Change-Id: I093fc0bdaf292fed2bc7f1a6d2678a94f25c9d55 CRs-fixed: 503216 506709 --- jni_mosaic/mosaic_renderer_jni.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jni_mosaic/mosaic_renderer_jni.cpp b/jni_mosaic/mosaic_renderer_jni.cpp index 36f8064c7..14db525a5 100644 --- a/jni_mosaic/mosaic_renderer_jni.cpp +++ b/jni_mosaic/mosaic_renderer_jni.cpp @@ -736,6 +736,10 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_step( gWarper2.DrawTexture(g_dTranslationToFBOCenterGL); + //clear the render target before drawing, + //fix the undefined buffer mess up issue of preview layer + gPreview.Clear(0.0, 0.0, 0.0, 1.0); + if (gIsLandscapeOrientation) { gPreview.DrawTexture(g_dAffinetransIdentGL); } else { @@ -754,6 +758,11 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_step( gWarper1.DrawTexture(g_dAffinetransGL); gWarper2.DrawTexture(g_dTranslationToFBOCenterGL); + + //clear the render target before drawing, + //fix the undefined buffer mess up issue of preview layer + gPreview.Clear(0.0, 0.0, 0.0, 1.0); + gPreview.DrawTexture(g_dAffinetransPanGL); gCurrentFBOIndex = 1 - gCurrentFBOIndex; -- cgit v1.2.3