am f59e3f36: Merge "Implement loadSystemProperties"

* commit 'f59e3f36dabcf395ea891d17d793f7088a3529e9':
  Implement loadSystemProperties
This commit is contained in:
John Reck
2014-05-06 16:19:32 +00:00
committed by Android Git Automerger
4 changed files with 23 additions and 1 deletions

View File

@@ -170,7 +170,7 @@ public class ThreadedRenderer extends HardwareRenderer {
@Override
boolean loadSystemProperties() {
return false;
return nLoadSystemProperties(mNativeProxy);
}
private void updateRootDisplayList(View view, HardwareDrawCallbacks callbacks) {
@@ -306,6 +306,7 @@ public class ThreadedRenderer extends HardwareRenderer {
private static native void nDeleteProxy(long nativeProxy);
private static native void nSetFrameInterval(long nativeProxy, long frameIntervalNanos);
private static native boolean nLoadSystemProperties(long nativeProxy);
private static native boolean nInitialize(long nativeProxy, Surface window);
private static native void nUpdateSurface(long nativeProxy, Surface window);

View File

@@ -158,6 +158,12 @@ static void android_view_ThreadedRenderer_setFrameInterval(JNIEnv* env, jobject
proxy->setFrameInterval(frameIntervalNanos);
}
static jboolean android_view_ThreadedRenderer_loadSystemProperties(JNIEnv* env, jobject clazz,
jlong proxyPtr) {
RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
return proxy->loadSystemProperties();
}
static jboolean android_view_ThreadedRenderer_initialize(JNIEnv* env, jobject clazz,
jlong proxyPtr, jobject jsurface) {
RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
@@ -268,6 +274,7 @@ static JNINativeMethod gMethods[] = {
{ "nCreateProxy", "(ZJ)J", (void*) android_view_ThreadedRenderer_createProxy },
{ "nDeleteProxy", "(J)V", (void*) android_view_ThreadedRenderer_deleteProxy },
{ "nSetFrameInterval", "(JJ)V", (void*) android_view_ThreadedRenderer_setFrameInterval },
{ "nLoadSystemProperties", "(J)Z", (void*) android_view_ThreadedRenderer_loadSystemProperties },
{ "nInitialize", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_initialize },
{ "nUpdateSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_updateSurface },
{ "nPauseSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_pauseSurface },

View File

@@ -98,6 +98,19 @@ void RenderProxy::setFrameInterval(nsecs_t frameIntervalNanos) {
post(task);
}
CREATE_BRIDGE0(loadSystemProperties) {
bool needsRedraw = false;
if (Caches::hasInstance()) {
needsRedraw = Caches::getInstance().initProperties();
}
return (void*) needsRedraw;
}
bool RenderProxy::loadSystemProperties() {
SETUP_TASK(loadSystemProperties);
return (bool) postAndWait(task);
}
CREATE_BRIDGE2(initialize, CanvasContext* context, EGLNativeWindowType window) {
return (void*) args->context->initialize(args->window);
}

View File

@@ -61,6 +61,7 @@ public:
ANDROID_API virtual ~RenderProxy();
ANDROID_API void setFrameInterval(nsecs_t frameIntervalNanos);
ANDROID_API bool loadSystemProperties();
ANDROID_API bool initialize(const sp<ANativeWindow>& window);
ANDROID_API void updateSurface(const sp<ANativeWindow>& window);