diff options
Diffstat (limited to 'WebCore/platform/graphics')
6 files changed, 23 insertions, 13 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index d2c41dc..584add1 100644 --- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -263,6 +263,7 @@ bool BaseLayerAndroid::drawGL(IntRect& viewRect, SkRect& visibleRect, XLOG("drawBasePicture drawGL() viewRect: %d, %d, %d, %d", left, top, width, height); + m_glWebViewState->setBackgroundColor(color); glClearColor((float)m_color.red() / 255.0, (float)m_color.green() / 255.0, (float)m_color.blue() / 255.0, 1); diff --git a/WebCore/platform/graphics/android/BaseTile.cpp b/WebCore/platform/graphics/android/BaseTile.cpp index a69e6f9..bfd5118 100644 --- a/WebCore/platform/graphics/android/BaseTile.cpp +++ b/WebCore/platform/graphics/android/BaseTile.cpp @@ -257,7 +257,7 @@ void BaseTile::paintBitmap() SkCanvas* canvas = texture->canvas(); canvas->save(); - canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); + canvas->drawColor(tiledPage->glWebViewState()->getBackgroundColor()); canvas->scale(scale, scale); canvas->translate(-x * w, -y * h); diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 71f3fe5..3d2f6c8 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -68,6 +68,7 @@ GLWebViewState::GLWebViewState(android::Mutex* buttonMutex) , m_usePageA(true) , m_globalButtonMutex(buttonMutex) , m_baseLayerUpdate(true) + , m_backgroundColor(SK_ColorWHITE) { m_viewport.setEmpty(); m_previousViewport.setEmpty(); diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h index 91bb2d7..d265b41 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.h +++ b/WebCore/platform/graphics/android/GLWebViewState.h @@ -208,6 +208,9 @@ public: bool drawGL(IntRect& rect, SkRect& viewport, float scale, SkColor color = SK_ColorWHITE); + void setBackgroundColor(SkColor color) { m_backgroundColor = color; } + SkColor getBackgroundColor() { return m_backgroundColor; } + private: void inval(const IntRect& rect); // caller must hold m_baseLayerLock @@ -247,6 +250,8 @@ private: bool m_baseLayerUpdate; IntRect m_invalidateRect; + + SkColor m_backgroundColor; }; } // namespace WebCore diff --git a/WebCore/platform/graphics/android/MediaLayer.cpp b/WebCore/platform/graphics/android/MediaLayer.cpp index ad4fc76..d8bbefc 100644 --- a/WebCore/platform/graphics/android/MediaLayer.cpp +++ b/WebCore/platform/graphics/android/MediaLayer.cpp @@ -78,8 +78,6 @@ bool MediaLayer::drawGL(SkMatrix& matrix) // draw any video content if present m_videoTexture->drawVideo(drawTransform()); - bool needsInval = true; - // draw the primary content if (m_bufferedTexture) { TextureInfo* textureInfo = m_bufferedTexture->consumerLock(); @@ -103,14 +101,11 @@ bool MediaLayer::drawGL(SkMatrix& matrix) textureInfo->m_textureId, 1.0f, forceBlending); } - - if (!rect.isEmpty()) - needsInval = false; } m_bufferedTexture->consumerRelease(); } - return drawChildrenGL(matrix) || needsInval; + return drawChildrenGL(matrix); } ANativeWindow* MediaLayer::acquireNativeWindowForVideo() diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp index a15e862..16fb782 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -55,10 +55,11 @@ // We need n textures for one TiledPage, and another n textures for the // second page used when scaling. // In our case, we use 300x300 textures. On the tablet, this equates to -// at least 5 * 3 = 15 textures. We can also enable offscreen textures +// at least 5 * 3 = 15 textures. We also enable offscreen textures to a maximum +// of 154 textures used (i.e. ~106Mb max, accounting for the double buffer textures) #define EXPANDED_TILE_BOUNDS_X 1 #define EXPANDED_TILE_BOUNDS_Y 4 -#define MAX_TEXTURE_ALLOCATION (5+1+EXPANDED_TILE_BOUNDS_X*2)*(3+1+EXPANDED_TILE_BOUNDS_Y*2)*2 +#define MAX_TEXTURE_ALLOCATION (5+EXPANDED_TILE_BOUNDS_X*2)*(3+EXPANDED_TILE_BOUNDS_Y*2)*2 #define TILE_WIDTH 300 #define TILE_HEIGHT 300 @@ -374,13 +375,20 @@ int TilesManager::maxTextureCount() void TilesManager::setMaxTextureCount(int max) { - XLOG("setMaxTextureCount: %d", max); - if (max > MAX_TEXTURE_ALLOCATION || - (m_maxTextureCount >= max && m_maxTextureCount)) + XLOG("setMaxTextureCount: %d (current: %d, total:%d)", + max, m_maxTextureCount, MAX_TEXTURE_ALLOCATION); + if (m_maxTextureCount && + (max > MAX_TEXTURE_ALLOCATION || + max <= m_maxTextureCount)) return; android::Mutex::Autolock lock(m_texturesLock); - m_maxTextureCount = max; + + if (max < MAX_TEXTURE_ALLOCATION) + m_maxTextureCount = max; + else + m_maxTextureCount = MAX_TEXTURE_ALLOCATION; + allocateTiles(); } |