diff options
author | John Reck <jreck@google.com> | 2011-11-21 14:11:48 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-21 14:11:48 -0800 |
commit | bd996ca3728f985d3fee81471268643ca772ed40 (patch) | |
tree | ca49832ee2e95da75bcf844bedf5824cf8f0e99d | |
parent | 67e6057679f9b91582e88911467d291c90eb42c9 (diff) | |
parent | 55b4bdbd661ac94fd05ab40de08250bf242d5346 (diff) | |
download | external_webkit-bd996ca3728f985d3fee81471268643ca772ed40.zip external_webkit-bd996ca3728f985d3fee81471268643ca772ed40.tar.gz external_webkit-bd996ca3728f985d3fee81471268643ca772ed40.tar.bz2 |
Merge "Use isHighEndGfx to double textures" into ics-mr1
4 files changed, 14 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 0b78373..5206b7a 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -86,6 +86,7 @@ GLWebViewState::GLWebViewState() , m_expandedTileBoundsY(0) , m_scale(1) , m_layersRenderingMode(kAllTextures) + , m_highEndGfx(false) { m_viewport.setEmpty(); m_futureViewportTileBounds.setEmpty(); @@ -262,7 +263,7 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) int viewMaxTileY = static_cast<int>(ceilf((viewport.height()-1) * invTileContentHeight)) + 1; int maxTextureCount = (viewMaxTileX + m_expandedTileBoundsX * 2) * - (viewMaxTileY + m_expandedTileBoundsY * 2) * 2; + (viewMaxTileY + m_expandedTileBoundsY * 2) * (m_highEndGfx ? 4 : 2); TilesManager::instance()->setMaxTextureCount(maxTextureCount); m_tiledPageA->updateBaseTileSize(); diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.h b/Source/WebCore/platform/graphics/android/GLWebViewState.h index 5aa030b..2a6c8df 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.h +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.h @@ -233,6 +233,7 @@ public: int expandedTileBoundsX() { return m_expandedTileBoundsX; } int expandedTileBoundsY() { return m_expandedTileBoundsY; } + void setHighEndGfx(bool highEnd) { m_highEndGfx = highEnd; } float scale() { return m_scale; } @@ -282,6 +283,7 @@ private: int m_expandedTileBoundsX; int m_expandedTileBoundsY; + bool m_highEndGfx; float m_scale; diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index 8339221..219435d 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -69,7 +69,7 @@ // number to cap the layer tile texturs, it worked on both phones and tablets. // TODO: after merge the pool of base tiles and layer tiles, we should revisit // the logic of allocation management. -#define MAX_TEXTURE_ALLOCATION ((6+TILE_PREFETCH_DISTANCE*2)*(5+TILE_PREFETCH_DISTANCE*2)*2) +#define MAX_TEXTURE_ALLOCATION ((6+TILE_PREFETCH_DISTANCE*2)*(5+TILE_PREFETCH_DISTANCE*2)*4) #define TILE_WIDTH 256 #define TILE_HEIGHT 256 #define LAYER_TILE_WIDTH 256 diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index c917a6c..13346b3 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -149,8 +149,10 @@ struct JavaGlue { } } m_javaGlue; -WebView(JNIEnv* env, jobject javaWebView, int viewImpl, WTF::String drawableDir) : +WebView(JNIEnv* env, jobject javaWebView, int viewImpl, WTF::String drawableDir, + bool isHighEndGfx) : m_ring((WebViewCore*) viewImpl) + , m_isHighEndGfx(isHighEndGfx) { jclass clazz = env->FindClass("android/webkit/WebView"); // m_javaGlue = new JavaGlue; @@ -454,6 +456,7 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect, if (!m_glWebViewState) { m_glWebViewState = new GLWebViewState(); + m_glWebViewState->setHighEndGfx(m_isHighEndGfx); m_glWebViewState->glExtras()->setCursorRingExtra(&m_ring); m_glWebViewState->glExtras()->setFindOnPageExtra(&m_findOnPage); if (m_baseLayer->content()) { @@ -1542,6 +1545,7 @@ private: // local state for WebView #endif RenderSkinButton* m_buttonSkin; SkRect m_visibleRect; + bool m_isHighEndGfx; }; // end of WebView class @@ -1662,10 +1666,11 @@ static void nativeClearCursor(JNIEnv *env, jobject obj) view->clearCursor(); } -static void nativeCreate(JNIEnv *env, jobject obj, int viewImpl, jstring drawableDir) +static void nativeCreate(JNIEnv *env, jobject obj, int viewImpl, + jstring drawableDir, jboolean isHighEndGfx) { WTF::String dir = jstringToWtfString(env, drawableDir); - WebView* webview = new WebView(env, obj, viewImpl, dir); + WebView* webview = new WebView(env, obj, viewImpl, dir, isHighEndGfx); // NEED THIS OR SOMETHING LIKE IT! //Release(obj); } @@ -2708,7 +2713,7 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeCacheHitNodePointer }, { "nativeClearCursor", "()V", (void*) nativeClearCursor }, - { "nativeCreate", "(ILjava/lang/String;)V", + { "nativeCreate", "(ILjava/lang/String;Z)V", (void*) nativeCreate }, { "nativeCursorFramePointer", "()I", (void*) nativeCursorFramePointer }, |