Skip to content

Commit

Permalink
webkit:Reduce processing in WebCore thread while scrolling and zooming
Browse files Browse the repository at this point in the history
Change-Id: I7554209dafcc7ded71b36fa3773b528d3ab2f9cf
  • Loading branch information
Shyama Prasad Mondal authored and hyperb1iss committed May 25, 2012
1 parent 1fbc74f commit 672f04f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Expand Up @@ -27,7 +27,7 @@
#include "TexturesGenerator.h"

#if USE(ACCELERATED_COMPOSITING)

#include "sys/types.h"
#include "BaseLayerAndroid.h"
#include "GLUtils.h"
#include "PaintTileOperation.h"
Expand Down Expand Up @@ -162,6 +162,7 @@ QueuedOperation* TexturesGenerator::popNext()

bool TexturesGenerator::threadLoop()
{
m_threadID = gettid();
// Check if we have any pending operations.
mRequestedOperationsLock.lock();
while (!mRequestedOperations.size())
Expand Down
Expand Up @@ -54,6 +54,7 @@ class TexturesGenerator : public Thread {
void removeOperationsForFilter(OperationFilter* filter, bool waitForRunning);

void scheduleOperation(QueuedOperation* operation);
int m_threadID;

private:
QueuedOperation* popNext();
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/platform/graphics/android/TilesManager.cpp
Expand Up @@ -116,6 +116,11 @@ TilesManager::TilesManager()
m_pixmapsGenerationThread->run("TexturesGenerator");
}

int TilesManager::getTextureManagerThreadID()
{
return m_pixmapsGenerationThread->m_threadID;
}

void TilesManager::allocateTiles()
{
int nbTexturesToAllocate = m_maxTextureCount - m_textures.size();
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/graphics/android/TilesManager.h
Expand Up @@ -198,6 +198,7 @@ class TilesManager {
{
return m_paintedSurfaces.size();
}
int getTextureManagerThreadID();

private:
TilesManager();
Expand Down
8 changes: 8 additions & 0 deletions Source/WebKit/android/jni/WebViewCore.cpp
Expand Up @@ -122,6 +122,7 @@
#include "autofill/WebAutofill.h"
#include "htmlediting.h"
#include "markup.h"
#include "TilesManager.h"

#include <JNIHelp.h>
#include <JNIUtility.h>
Expand Down Expand Up @@ -4443,6 +4444,11 @@ static void SetNewStorageLimit(JNIEnv* env, jobject obj, jlong quota) {
#endif
}

static jint GetTextureGeneratorThreadID(JNIEnv* env, jobject obj) {
return TilesManager::instance()->getTextureManagerThreadID();
}


// Called from Java to provide a Geolocation permission state for the specified origin.
static void GeolocationPermissionsProvide(JNIEnv* env, jobject obj, jstring origin, jboolean allow, jboolean remember) {
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
Expand Down Expand Up @@ -4734,6 +4740,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) DumpV8Counters },
{ "nativeSetNewStorageLimit", "(J)V",
(void*) SetNewStorageLimit },
{ "nativeGetTextureGeneratorThreadID", "()I",
(void*) GetTextureGeneratorThreadID },
{ "nativeGeolocationPermissionsProvide", "(Ljava/lang/String;ZZ)V",
(void*) GeolocationPermissionsProvide },
{ "nativeSetIsPaused", "(Z)V", (void*) SetIsPaused },
Expand Down

0 comments on commit 672f04f

Please sign in to comment.