forked from organicmaps/organicmaps-tmp
[android] refactored RenderPolicy initialization.
This commit is contained in:
parent
2a859dfefd
commit
39401b7e18
4 changed files with 27 additions and 25 deletions
|
@ -63,25 +63,32 @@ namespace android
|
|||
m_work.SetRenderPolicy(0);
|
||||
}
|
||||
|
||||
void Framework::InitRenderPolicy()
|
||||
bool Framework::InitRenderPolicy()
|
||||
{
|
||||
LOG(LDEBUG, ("AF::InitRenderer 1"));
|
||||
|
||||
DrawerYG::Params params;
|
||||
params.m_frameBuffer = make_shared_ptr(new yg::gl::FrameBuffer(true));
|
||||
|
||||
yg::ResourceManager::Params rmParams;
|
||||
rmParams.m_videoMemoryLimit = 15 * 1024 * 1024;
|
||||
rmParams.m_rtFormat = yg::Rt8Bpp;
|
||||
|
||||
m_work.SetRenderPolicy(new PartialRenderPolicy(m_videoTimer,
|
||||
params,
|
||||
rmParams,
|
||||
make_shared_ptr(new android::RenderContext())));
|
||||
RenderPolicy * renderPolicy = new PartialRenderPolicy(m_videoTimer,
|
||||
true,
|
||||
rmParams,
|
||||
make_shared_ptr(new android::RenderContext()));
|
||||
|
||||
if (renderPolicy == 0)
|
||||
{
|
||||
LOG(LINFO, ("No Render Policy is created"));
|
||||
return false;
|
||||
}
|
||||
|
||||
m_work.SetRenderPolicy(renderPolicy);
|
||||
|
||||
m_work.SetUpdatesEnabled(true);
|
||||
|
||||
LOG(LDEBUG, ("AF::InitRenderer 3"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
storage::Storage & Framework::Storage()
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace android
|
|||
|
||||
void Invalidate();
|
||||
|
||||
void InitRenderPolicy();
|
||||
bool InitRenderPolicy();
|
||||
void DeleteRenderPolicy();
|
||||
|
||||
void Resize(int w, int h);
|
||||
|
|
|
@ -51,13 +51,8 @@ bool SetupGLESResources()
|
|||
if (s_glesLoaded)
|
||||
return true;
|
||||
|
||||
NVDEBUG(reinterpret_cast<char const *>(glGetString(GL_EXTENSIONS)));
|
||||
NVDEBUG(reinterpret_cast<char const *>(glGetString(GL_VENDOR)));
|
||||
NVDEBUG(reinterpret_cast<char const *>(glGetString(GL_RENDERER)));
|
||||
NVDEBUG(reinterpret_cast<char const *>(glGetString(GL_VERSION)));
|
||||
// NVDEBUG(reinterpret_cast<char const *>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
|
||||
|
||||
g_framework->InitRenderPolicy();
|
||||
if (!g_framework->InitRenderPolicy())
|
||||
return false;
|
||||
|
||||
s_glesLoaded = true;
|
||||
|
||||
|
|
|
@ -34,39 +34,39 @@ namespace android
|
|||
|
||||
void VideoTimer::start()
|
||||
{
|
||||
JNIEnv * env;
|
||||
/*JNIEnv * env;
|
||||
m_javaVM->AttachCurrentThread(&env, NULL);
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "start", "()V"));
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "start", "()V"));*/
|
||||
m_state = ERunning;
|
||||
}
|
||||
|
||||
void VideoTimer::resume()
|
||||
{
|
||||
JNIEnv * env;
|
||||
/*JNIEnv * env;
|
||||
m_javaVM->AttachCurrentThread(&env, NULL);
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "resume", "()V"));
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "resume", "()V"));*/
|
||||
m_state = ERunning;
|
||||
}
|
||||
|
||||
void VideoTimer::pause()
|
||||
{
|
||||
JNIEnv * env;
|
||||
/*JNIEnv * env;
|
||||
m_javaVM->AttachCurrentThread(&env, NULL);
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "pause", "()V"));
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "pause", "()V"));*/
|
||||
m_state = EPaused;
|
||||
}
|
||||
|
||||
void VideoTimer::stop()
|
||||
{
|
||||
JNIEnv * env;
|
||||
/*JNIEnv * env;
|
||||
m_javaVM->AttachCurrentThread(&env, NULL);
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "stop", "()V"));
|
||||
env->CallVoidMethod(m_videoTimer, jni::GetJavaMethodID(env, m_videoTimer, "stop", "()V"));*/
|
||||
m_state = EStopped;
|
||||
}
|
||||
|
||||
void VideoTimer::perform()
|
||||
{
|
||||
m_frameFn();
|
||||
//m_frameFn();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue