From 274ca49c63557a8c3ee12c8da5f75e28b4875a5d Mon Sep 17 00:00:00 2001 From: Wei-Ta Chen Date: Sun, 11 Sep 2011 14:28:53 -0700 Subject: Clean up the logs. Bug: 5277853 Change-Id: Ic1c9a0395846b6815f2c18663e3c9078781a6194 --- jni/mosaic_renderer_jni.cpp | 53 +++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'jni/mosaic_renderer_jni.cpp') diff --git a/jni/mosaic_renderer_jni.cpp b/jni/mosaic_renderer_jni.cpp index b0d6b44..11e7712 100644 --- a/jni/mosaic_renderer_jni.cpp +++ b/jni/mosaic_renderer_jni.cpp @@ -1,23 +1,36 @@ -// OpenGL ES 2.0 code +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include #include -#include - -#include +#include +#include +#include +#include "db_utilities_camera.h" #include "mosaic/ImageUtils.h" #include "mosaic_renderer/FrameBuffer.h" #include "mosaic_renderer/WarpRenderer.h" #include "mosaic_renderer/SurfaceTextureRenderer.h" #include "mosaic_renderer/YVURenderer.h" -#include -#include -#include -#include "mosaic_renderer_jni.h" +#include "mosaic/Log.h" +#define LOG_TAG "MosaicRenderer" -#define LOG_TAG "MosaicRenderer" -#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) -#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#include "mosaic_renderer_jni.h" // Texture handle GLuint gSurfaceTextureID[1]; @@ -139,14 +152,14 @@ const int GL_TEXTURE_EXTERNAL_OES_ENUM = 0x8D65; static void printGLString(const char *name, GLenum s) { const char *v = (const char *) glGetString(s); - LOGI("GL %s = %s\n", name, v); + LOGI("GL %s = %s", name, v); } // @return false if there was an error bool checkGlError(const char* op) { GLint error = glGetError(); if (error != 0) { - LOGE("after %s() glError (0x%x)\n", op, error); + LOGE("after %s() glError (0x%x)", op, error); return false; } return true; @@ -565,15 +578,9 @@ JNIEXPORT void JNICALL Java_com_android_camera_panorama_MosaicRenderer_transferG { double t0, t1, time_c; - t0 = now_ms(); - gYVURenderer[LR].DrawTexture(); gYVURenderer[HR].DrawTexture(); - t1 = now_ms(); - time_c = t1 - t0; - LOGV("YVU Rendering: %g ms", time_c); - sem_wait(&gPreviewImage_semaphore); // Bind to the input LR FBO and read the Low-Res data from there... glBindFramebuffer(GL_FRAMEBUFFER, gBufferInputYVU[LR].GetFrameBufferName()); @@ -587,9 +594,6 @@ JNIEXPORT void JNICALL Java_com_android_camera_panorama_MosaicRenderer_transferG gPreviewImage[LR]); checkGlError("glReadPixels LR"); - t1 = now_ms(); - time_c = t1 - t0; - LOGV("glReadPixels LR: %g ms", time_c); // Bind to the input HR FBO and read the high-res data from there... glBindFramebuffer(GL_FRAMEBUFFER, gBufferInputYVU[HR].GetFrameBufferName()); @@ -603,9 +607,6 @@ JNIEXPORT void JNICALL Java_com_android_camera_panorama_MosaicRenderer_transferG gPreviewImage[HR]); checkGlError("glReadPixels HR"); - t1 = now_ms(); - time_c = t1 - t0; - LOGV("glReadPixels HR: %g ms", time_c); sem_post(&gPreviewImage_semaphore); } -- cgit v1.1