summaryrefslogtreecommitdiffstats
path: root/perf
diff options
context:
space:
mode:
authorPatrick Scott <>2009-03-24 20:40:43 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 20:40:43 -0700
commit1da4c23e4d3bab3ac6655659ea441f46f28cf485 (patch)
tree629010e92a8bf53b0ed124bb4519ffa9b5186a4f /perf
parent53e2041125abf29c826b16dc484d27d97ccbcc20 (diff)
downloadexternal_webkit-1da4c23e4d3bab3ac6655659ea441f46f28cf485.zip
external_webkit-1da4c23e4d3bab3ac6655659ea441f46f28cf485.tar.gz
external_webkit-1da4c23e4d3bab3ac6655659ea441f46f28cf485.tar.bz2
Automated import from //branches/master/...@141633,141633
Diffstat (limited to 'perf')
-rw-r--r--perf/Android.mk33
-rw-r--r--perf/MyJavaVM.cpp2
-rw-r--r--perf/main.cpp61
3 files changed, 60 insertions, 36 deletions
diff --git a/perf/Android.mk b/perf/Android.mk
index 379553d..2d7bd92 100644
--- a/perf/Android.mk
+++ b/perf/Android.mk
@@ -41,16 +41,6 @@ LOCAL_CFLAGS += -include "WebCorePrefixAndroid.h"
LOCAL_C_INCLUDES := \
$(JNI_H_INCLUDE) \
external/webkit \
- $(WEBCORE) \
- $(WEBCORE)/page \
- $(WEBCORE)/platform \
- $(WEBCORE)/platform/graphics \
- $(WEBCORE)/platform/network \
- $(WEBCORE)/platform/text \
- $(WEBCORE)/rendering \
- $(WEBKIT) \
- $(WEBKIT)/android/stl \
- $(JSC) \
external/icu4c/common \
external/libxml2/include \
external/skia/include/effects \
@@ -59,6 +49,9 @@ LOCAL_C_INCLUDES := \
external/skia/include/utils \
external/skia/src/ports \
external/sqlite/dist \
+ $(WEBKIT) \
+ $(WEBKIT)/android/stl \
+ $(WEBCORE) \
$(WEBCORE)/bindings/js \
$(WEBCORE)/bridge \
$(WEBCORE)/bridge/c \
@@ -72,15 +65,23 @@ LOCAL_C_INCLUDES := \
$(WEBCORE)/loader \
$(WEBCORE)/loader/appcache \
$(WEBCORE)/loader/icon \
+ $(WEBCORE)/page \
$(WEBCORE)/page/android \
$(WEBCORE)/page/animation \
+ $(WEBCORE)/platform \
$(WEBCORE)/platform/android \
+ $(WEBCORE)/platform/animation \
+ $(WEBCORE)/platform/graphics \
$(WEBCORE)/platform/graphics/android \
$(WEBCORE)/platform/graphics/network \
+ $(WEBCORE)/platform/graphics/transforms \
$(WEBCORE)/platform/image-decoders \
+ $(WEBCORE)/platform/network \
$(WEBCORE)/platform/network/android \
$(WEBCORE)/platform/sql \
+ $(WEBCORE)/platform/text \
$(WEBCORE)/plugins \
+ $(WEBCORE)/rendering \
$(WEBCORE)/rendering/style \
$(WEBCORE)/storage \
$(WEBCORE)/xml \
@@ -89,18 +90,24 @@ LOCAL_C_INCLUDES := \
$(WEBKIT)/android/nav \
$(WEBKIT)/android/plugins \
$(WEBKIT)/android/WebCoreSupport \
+ $(JSC) \
$(JSC)/API \
- $(JSC)/VM \
+ $(JSC)/assembler \
+ $(JSC)/bytecode \
+ $(JSC)/bytecompiler \
$(JSC)/debugger \
- $(JSC)/kjs \
- $(JSC)/icu \
+ $(JSC)/parser \
+ $(JSC)/jit \
+ $(JSC)/interpreter \
$(JSC)/pcre \
$(JSC)/profiler \
$(JSC)/runtime \
+ $(JSC)/wrec \
$(JSC)/wtf \
$(JSC)/wtf/unicode \
$(JSC)/wtf/unicode/icu \
$(JSC)/ForwardingHeaders \
+ $(base_intermediates)/WebCore/page \
$(call include-path-for, corecg graphics)
LOCAL_SHARED_LIBRARIES := libwebcore
diff --git a/perf/MyJavaVM.cpp b/perf/MyJavaVM.cpp
index d536e6f..82eea2a 100644
--- a/perf/MyJavaVM.cpp
+++ b/perf/MyJavaVM.cpp
@@ -83,6 +83,7 @@ jstring env_newString(JNIEnv*, const jchar*, jsize) {
}
void env_releaseByteArrayElements(JNIEnv*, jbyteArray, jbyte*, jint) {}
void env_releaseStringChars(JNIEnv*, jstring, const jchar*) {}
+void env_setByteArrayRegion(JNIEnv*, jbyteArray, jsize, jsize, const jbyte*) {}
void env_setIntField(JNIEnv*, jobject, jfieldID, jint) {}
void InitializeJavaVM() {
@@ -119,6 +120,7 @@ void InitializeJavaVM() {
n->NewString = env_newString;
n->ReleaseByteArrayElements = env_releaseByteArrayElements;
n->ReleaseStringChars = env_releaseStringChars;
+ n->SetByteArrayRegion = env_setByteArrayRegion;
n->SetIntField = env_setIntField;
// Tell WebCore about the vm
diff --git a/perf/main.cpp b/perf/main.cpp
index cb5358d..9314e42 100644
--- a/perf/main.cpp
+++ b/perf/main.cpp
@@ -75,6 +75,7 @@ public:
virtual void setSharedTimer(long long timemillis) { m_hasTimer = true; }
virtual void stopSharedTimer() { m_hasTimer = false; }
virtual void setSharedTimerCallback(void (*f)()) { m_func = f; }
+ virtual void signalServiceFuncPtrQueue() {}
// Cookie methods that do nothing.
virtual void setCookies(const KURL&, const KURL&, const String&) {}
@@ -93,24 +94,29 @@ static void historyItemChanged(HistoryItem* i) {
int main(int argc, char** argv) {
int width = 800;
int height = 600;
- if (argc <= 1) {
- LOGE("Please supply a file to read\n");
- return 1;
- } else {
- while (true) {
- int c = getopt(argc, argv, "d:");
- if (c == -1)
- break;
- else if (c == 'd') {
- char* x = strchr(optarg, 'x');
- if (x) {
- width = atoi(optarg);
- height = atoi(x + 1);
- LOGD("Rendering page at %dx%d", width, height);
- }
+ int reloadCount = 0;
+ while (true) {
+ int c = getopt(argc, argv, "d:r:");
+ if (c == -1)
+ break;
+ else if (c == 'd') {
+ char* x = strchr(optarg, 'x');
+ if (x) {
+ width = atoi(optarg);
+ height = atoi(x + 1);
+ LOGD("Rendering page at %dx%d", width, height);
}
+ } else if (c == 'r') {
+ reloadCount = atoi(optarg);
+ if (reloadCount < 0)
+ reloadCount = 0;
+ LOGD("Reloading %d times", reloadCount);
}
}
+ if (optind >= argc) {
+ LOGE("Please supply a file to read\n");
+ return 1;
+ }
JSC::initializeThreading();
@@ -187,16 +193,25 @@ int main(int argc, char** argv) {
// Finally, load the actual data
ResourceRequest req(argv[optind]);
- frame->loader()->load(req);
+ frame->loader()->load(req, false);
- // Layout the page and service the timer
- frameView->layout();
- while (client.m_hasTimer)
- client.m_func();
-
- // Layout more if needed.
- while (frameView->needsLayout())
+ do {
+ // Layout the page and service the timer
frameView->layout();
+ while (client.m_hasTimer) {
+ client.m_func();
+ JavaSharedClient::ServiceFunctionPtrQueue();
+ }
+ JavaSharedClient::ServiceFunctionPtrQueue();
+
+ // Layout more if needed.
+ while (frameView->needsLayout())
+ frameView->layout();
+ JavaSharedClient::ServiceFunctionPtrQueue();
+
+ if (reloadCount)
+ frame->loader()->reload(true);
+ } while (reloadCount--);
// Draw into an offscreen bitmap
SkBitmap bmp;