diff options
Diffstat (limited to 'Source/WebCore')
9 files changed, 43 insertions, 29 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 99eb1c6..1b0513b 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -132,10 +132,10 @@ void GLWebViewState::setViewport(const SkRect& viewport, float scale) int viewMaxTileX = static_cast<int>(ceilf((viewport.width()-1) * invTileContentWidth)) + 1; int viewMaxTileY = static_cast<int>(ceilf((viewport.height()-1) * invTileContentHeight)) + 1; - TilesManager* manager = TilesManager::instance(); - int maxTextureCount = viewMaxTileX * viewMaxTileY * (manager->highEndGfx() ? 4 : 2); + TilesManager* tilesManager = TilesManager::instance(); + int maxTextureCount = viewMaxTileX * viewMaxTileY * (tilesManager->highEndGfx() ? 4 : 2); - manager->setMaxTextureCount(maxTextureCount); + tilesManager->setMaxTextureCount(maxTextureCount); // TODO: investigate whether we can move this return earlier. if ((m_viewport == viewport) diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp index 1de5ae7..ce520b4 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp @@ -53,4 +53,17 @@ void BaseLayerAndroid::getLocalTransform(SkMatrix* matrix) const matrix->preConcat(getMatrix()); } +IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer) +{ + if (viewport.fRight > getWidth() || viewport.fBottom > getHeight()) { + // To handle the viewport expanding past the layer's size with HW accel, + // expand the size of the layer, so that tiles will cover the viewport. + setSize(std::max(viewport.fRight, getWidth()), + std::max(viewport.fBottom, getHeight())); + } + + return LayerAndroid::updatePosition(viewport, parentIframeLayer); +} + } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h index 0ef39c8..f4cf9f3 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h @@ -49,6 +49,8 @@ public: virtual void getLocalTransform(SkMatrix* matrix) const; virtual const TransformationMatrix* drawTransform() const { return 0; } + virtual IFrameLayerAndroid* updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer); private: // TODO: move to SurfaceCollection. Color m_color; diff --git a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp index b2ead6a..9890331 100644 --- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp @@ -174,8 +174,8 @@ bool ImageTexture::prepareGL(GLWebViewState* state) return false; if (!m_texture && m_picture) { - bool isLayerTile = true; - m_texture = new TileGrid(isLayerTile); + bool isBaseSurface = false; + m_texture = new TileGrid(isBaseSurface); SkRegion region; region.setRect(0, 0, m_image->width(), m_image->height()); m_texture->markAsDirty(region); @@ -198,8 +198,6 @@ const TransformationMatrix* ImageTexture::transform() if (!m_layer) return 0; - FloatPoint p(0, 0); - p = m_layer->drawTransform()->mapPoint(p); IntRect layerArea = m_layer->unclippedArea(); float scaleW = static_cast<float>(layerArea.width()) / static_cast<float>(m_image->width()); float scaleH = static_cast<float>(layerArea.height()) / static_cast<float>(m_image->height()); diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp index 8fb4d4b..91335c7 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp @@ -205,9 +205,17 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect, returnFlags |= uirenderer::DrawGlInfo::kStatusInvoke; if (!shouldDraw) { - if (didCollectionSwap) { + if (didCollectionSwap + || (!m_paintingCollection + && m_drawingCollection + && m_drawingCollection->isReady())) { + // either a swap just occurred, or there is no more work to be done: do a full draw m_drawingCollection->swapTiles(); returnFlags |= uirenderer::DrawGlInfo::kStatusDraw; + } else { + // current collection not ready - invoke functor in process mode + // until either drawing or painting collection is ready + returnFlags |= uirenderer::DrawGlInfo::kStatusInvoke; } return returnFlags; diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp index 35fded1..178958d 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp @@ -511,11 +511,6 @@ void Tile::validatePaint() { // paintBitmap() may have cleared m_dirty) m_dirty = true; } - - if (m_deferredDirty) { - ALOGV("Note: deferred dirty flag set, possibly a missed paint on tile %p", this); - m_deferredDirty = false; - } } else { ALOGV("Note: paint was unsuccessful."); m_state = Unpainted; diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.h b/Source/WebCore/platform/graphics/android/rendering/Tile.h index 7010301..cc10799 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.h +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.h @@ -151,9 +151,6 @@ private: // redrawn in the backTexture bool m_dirty; - // currently only for debugging, to be used for tracking down dropped repaints - bool m_deferredDirty; - // used to signal that a repaint is pending bool m_repaintPending; diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp index 5ce63bf..2510d52 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp @@ -80,7 +80,7 @@ bool TileGrid::isReady() // in order to unblock the zooming process. // FIXME: have a better system -- maybe keeping the last scale factor // able to fully render everything - ALOGV("TT %p, ready %d, visible %d, texturesRemain %d", + ALOGV("TG %p, ready %d, visible %d, texturesRemain %d", this, tilesAllReady, tilesVisible, TilesManager::instance()->layerTexturesRemain()); @@ -102,7 +102,7 @@ void TileGrid::swapTiles() for (unsigned int i = 0; i < m_tiles.size(); i++) if (m_tiles[i]->swapTexturesIfNeeded()) swaps++; - ALOGV("TT %p swapping, swaps = %d", this, swaps); + ALOGV("TG %p swapping, swaps = %d", this, swaps); } IntRect TileGrid::computeTilesArea(const IntRect& contentArea, float scale) @@ -113,7 +113,7 @@ IntRect TileGrid::computeTilesArea(const IntRect& contentArea, float scale) ceilf(contentArea.width() * scale), ceilf(contentArea.height() * scale)); - ALOGV("TT %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height()); + ALOGV("TG %p prepare, scale %f, area %d x %d", this, scale, area.width(), area.height()); if (area.width() == 0 && area.height() == 0) { computedArea.setWidth(0); @@ -153,8 +153,9 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, bool goingDown = m_prevTileY < m_area.y(); m_prevTileY = m_area.y(); + TilesManager* tilesManager = TilesManager::instance(); if (scale != m_scale) - TilesManager::instance()->removeOperationsForFilter(new ScaleFilter(painter, m_scale)); + tilesManager->removeOperationsForFilter(new ScaleFilter(painter, m_scale)); m_scale = scale; @@ -164,11 +165,11 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, m_tiles[i]->markAsDirty(m_dirtyRegion); // log inval region for the base surface - if (m_isBaseSurface && TilesManager::instance()->getProfiler()->enabled()) { + if (m_isBaseSurface && tilesManager->getProfiler()->enabled()) { SkRegion::Iterator iterator(m_dirtyRegion); while (!iterator.done()) { SkIRect r = iterator.rect(); - TilesManager::instance()->getProfiler()->nextInval(r, scale); + tilesManager->getProfiler()->nextInval(r, scale); iterator.next(); } } @@ -193,8 +194,8 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, IntRect fullArea = computeTilesArea(unclippedArea, scale); IntRect expandedArea = m_area; - // on systems reporting highEndGfx=true, use expanded high res bounds - if (TilesManager::instance()->highEndGfx()) + // on systems reporting highEndGfx=true and useMinimalMemory not set, use expanded bounds + if (tilesManager->highEndGfx() && !tilesManager->useMinimalMemory()) expandedArea.inflate(EXPANDED_BOUNDS_INFLATE); if (isLowResPrefetch) @@ -212,7 +213,7 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, void TileGrid::markAsDirty(const SkRegion& invalRegion) { - ALOGV("TT %p markAsDirty, current region empty %d, new empty %d", + ALOGV("TG %p markAsDirty, current region empty %d, new empty %d", this, m_dirtyRegion.isEmpty(), invalRegion.isEmpty()); m_dirtyRegion.op(invalRegion, SkRegion::kUnion_Op); } @@ -238,7 +239,7 @@ void TileGrid::prepareTile(int x, int y, TilePainter* painter, tile->reserveTexture(); if (tile->backTexture() && tile->isDirty() && !tile->isRepaintPending()) { - ALOGV("painting TT %p's tile %d %d for LG %p", this, x, y, painter); + ALOGV("painting TG %p's tile %d %d for LG %p", this, x, y, painter); PaintTileOperation *operation = new PaintTileOperation(tile, painter, state, isLowResPrefetch); TilesManager::instance()->scheduleOperation(operation); @@ -329,7 +330,7 @@ void TileGrid::drawGL(const IntRect& visibleArea, float opacity, if (semiOpaqueBaseSurface) drawMissingRegion(missingRegion, opacity, background); - ALOGV("TT %p drew %d tiles, scale %f", + ALOGV("TG %p drew %d tiles, scale %f", this, drawn, m_scale); } @@ -371,7 +372,7 @@ void TileGrid::removeTiles() void TileGrid::discardTextures() { - ALOGV("TT %p discarding textures", this); + ALOGV("TG %p discarding textures", this); for (unsigned int i = 0; i < m_tiles.size(); i++) m_tiles[i]->discardTextures(); } diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp index ec0d9e7..af19f30 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp @@ -102,7 +102,7 @@ void TransferQueue::initGLResources(int width, int height) m_sharedSurfaceTexture = #if GPU_UPLOAD_WITHOUT_DRAW new android::SurfaceTexture(m_sharedSurfaceTextureId, true, - GL_TEXTURE_2D, false, bufferQueue); + GL_TEXTURE_2D, true, bufferQueue); #else new android::SurfaceTexture(m_sharedSurfaceTextureId, true, GL_TEXTURE_EXTERNAL_OES, true, |