diff options
14 files changed, 17 insertions, 107 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index a8c4d7a..15595e4 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -101,14 +101,6 @@ void BaseLayerAndroid::setContent(const PictureSet& src) // setSize(src.width(), src.height()); } -void BaseLayerAndroid::setExtra(SkPicture& src) -{ -#if USE(ACCELERATED_COMPOSITING) - android::Mutex::Autolock lock(m_drawLock); -#endif - m_extra.swap(src); -} - void BaseLayerAndroid::drawCanvas(SkCanvas* canvas) { #if USE(ACCELERATED_COMPOSITING) @@ -116,9 +108,6 @@ void BaseLayerAndroid::drawCanvas(SkCanvas* canvas) #endif if (!m_content.isEmpty()) m_content.draw(canvas); - // TODO : replace with !m_extra.isEmpty() once such a call exists - if (m_extra.width() > 0) - m_extra.draw(canvas); } #if USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h index 26fd158..09a086a 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h @@ -53,7 +53,6 @@ public: Color getBackgroundColor() { return m_color; } #endif void setContent(const android::PictureSet& src); - void setExtra(SkPicture& extra); android::PictureSet* content() { return &m_content; } // This method will paint using the current PictureSet onto // the passed canvas. We used it to paint the GL tiles as well as @@ -63,7 +62,6 @@ public: bool drawGL(double currentTime, LayerAndroid* compositedRoot, IntRect& rect, SkRect& viewport, float scale, bool* buffersSwappedPtr); - void swapExtra(BaseLayerAndroid* base) { m_extra.swap(base->m_extra); } private: #if USE(ACCELERATED_COMPOSITING) void prefetchBasePicture(SkRect& viewport, float currentScale, @@ -76,7 +74,6 @@ private: Color m_color; #endif android::PictureSet m_content; - SkPicture m_extra; SkRect m_previousVisible; ScrollState m_scrollState; diff --git a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp index 96599af..57baee8 100644 --- a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp +++ b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp @@ -133,8 +133,6 @@ int BaseRenderer::renderTiledContent(const TileRenderInfo& renderInfo) canvas.scale(renderInfo.scale, renderInfo.scale); unsigned int pictureCount = 0; renderInfo.tilePainter->paint(renderInfo.baseTile, &canvas, &pictureCount); - if (renderInfo.baseTile->isLayerTile()) - renderInfo.tilePainter->paintExtra(&canvas); if (visualIndicator) { canvas.restore(); diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 7b43305..4c6161a 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -147,8 +147,6 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval m_baseLayerUpdate = true; m_invalidateRegion.setEmpty(); } - if (m_currentBaseLayer && layer) - m_currentBaseLayer->swapExtra(layer); SkSafeRef(layer); SkSafeUnref(m_currentBaseLayer); diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp index d4a1225..e0898e6 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -66,7 +66,6 @@ LayerAndroid::LayerAndroid(RenderLayer* owner) : Layer(), m_preserves3D(false), m_anchorPointZ(0), m_recordingPicture(0), - m_extra(0), m_uniqueId(++gUniqueId), m_texture(0), m_imageRef(0), @@ -93,7 +92,6 @@ LayerAndroid::LayerAndroid(RenderLayer* owner) : Layer(), LayerAndroid::LayerAndroid(const LayerAndroid& layer) : Layer(layer), m_haveClip(layer.m_haveClip), m_isIframe(layer.m_isIframe), - m_extra(0), // deliberately not copied m_uniqueId(layer.m_uniqueId), m_texture(0), m_imageTexture(0), @@ -154,7 +152,6 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : Layer(), m_isFixed(false), m_isIframe(false), m_recordingPicture(picture), - m_extra(0), m_uniqueId(-1), m_texture(0), m_imageRef(0), @@ -180,7 +177,6 @@ LayerAndroid::~LayerAndroid() { if (m_imageTexture) ImagesManager::instance()->removeImage(m_imageTexture->imageRef()); - delete m_extra; SkSafeUnref(m_recordingPicture); m_animations.clear(); #ifdef DEBUG_COUNT @@ -929,14 +925,6 @@ bool LayerAndroid::drawChildrenGL(GLWebViewState* glWebViewState, SkMatrix& matr return askScreenUpdate; } -void LayerAndroid::extraDraw(SkCanvas* canvas) -{ - m_atomicSync.lock(); - if (m_extra) - canvas->drawPicture(*m_extra); - m_atomicSync.unlock(); -} - void LayerAndroid::contentDraw(SkCanvas* canvas) { if (m_recordingPicture) @@ -1230,32 +1218,6 @@ LayerAndroid* LayerAndroid::findById(int match) return 0; } -void LayerAndroid::setExtra(DrawExtra* extra) -{ - for (int i = 0; i < countChildren(); i++) - getChild(i)->setExtra(extra); - - android::AutoMutex lock(m_atomicSync); - if (extra || (m_extra && !extra)) - m_dirty = true; - - delete m_extra; - m_extra = 0; - - if (!extra) - return; - - if (m_recordingPicture) { - IntRect dummy; // inval area, unused for now - m_extra = new SkPicture(); - SkCanvas* canvas = m_extra->beginRecording(m_recordingPicture->width(), - m_recordingPicture->height()); - extra->draw(canvas, this, &dummy); - m_extra->endRecording(); - needsRepaint(); - } -} - } // namespace WebCore #endif // USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h index 4458a2c..15a581e 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h @@ -233,7 +233,6 @@ public: { return static_cast<LayerAndroid*>(this->INHERITED::getChild(index)); } - void setExtra(DrawExtra* extra); // does not assign ownership int uniqueId() const { return m_uniqueId; } bool isFixed() { return m_isFixed; } @@ -257,7 +256,6 @@ public: const SkRegion& dirtyRegion() { return m_dirtyRegion; } void contentDraw(SkCanvas*); - void extraDraw(SkCanvas*); virtual bool isMedia() const { return false; } virtual bool isVideo() const { return false; } @@ -357,7 +355,6 @@ private: FloatRect m_clippingRect; - SkPicture* m_extra; int m_uniqueId; PaintedSurface* m_texture; diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp index 00129a0..2b24e9e 100644 --- a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp +++ b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp @@ -179,19 +179,6 @@ void PaintedSurface::markAsDirty(const SkRegion& dirtyArea) m_updateManager.updateInval(dirtyArea); } -void PaintedSurface::paintExtra(SkCanvas* canvas) -{ - m_layerLock.lock(); - LayerAndroid* layer = m_layer; - SkSafeRef(layer); - m_layerLock.unlock(); - - if (layer) - layer->extraDraw(canvas); - - SkSafeUnref(layer); -} - float PaintedSurface::opacity() { if (m_layer) return m_layer->drawOpacity(); diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.h b/Source/WebCore/platform/graphics/android/PaintedSurface.h index 761be74..2e01b80 100644 --- a/Source/WebCore/platform/graphics/android/PaintedSurface.h +++ b/Source/WebCore/platform/graphics/android/PaintedSurface.h @@ -66,7 +66,6 @@ public: void computeVisibleArea(); // TilePainter methods for TiledTexture - virtual void paintExtra(SkCanvas*); virtual const TransformationMatrix* transform(); // used by TiledTexture diff --git a/Source/WebCore/platform/graphics/android/TilePainter.h b/Source/WebCore/platform/graphics/android/TilePainter.h index 191edf3..91030cb 100644 --- a/Source/WebCore/platform/graphics/android/TilePainter.h +++ b/Source/WebCore/platform/graphics/android/TilePainter.h @@ -38,7 +38,6 @@ class TilePainter { public: virtual ~TilePainter() { } virtual bool paint(BaseTile* tile, SkCanvas*, unsigned int*) = 0; - virtual void paintExtra(SkCanvas*) = 0; virtual const TransformationMatrix* transform() { return 0; } }; diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp index b3b4daf..99d8a47 100644 --- a/Source/WebCore/platform/graphics/android/TiledPage.cpp +++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp @@ -383,10 +383,6 @@ bool TiledPage::paint(BaseTile* tile, SkCanvas* canvas, unsigned int* pictureUse return true; } -void TiledPage::paintExtra(SkCanvas* canvas) -{ -} - TiledPage* TiledPage::sibling() { if (!m_glWebViewState) diff --git a/Source/WebCore/platform/graphics/android/TiledPage.h b/Source/WebCore/platform/graphics/android/TiledPage.h index 718908d..764bb36 100644 --- a/Source/WebCore/platform/graphics/android/TiledPage.h +++ b/Source/WebCore/platform/graphics/android/TiledPage.h @@ -83,7 +83,6 @@ public: // TilePainter implementation // used by individual tiles to generate the bitmap for their tile bool paint(BaseTile*, SkCanvas*, unsigned int*); - void paintExtra(SkCanvas*); // used by individual tiles to get the information about the current picture GLWebViewState* glWebViewState() { return m_glWebViewState; } diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp index 87996ab..35ce35f 100644 --- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp +++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp @@ -257,11 +257,6 @@ bool TiledTexture::paint(BaseTile* tile, SkCanvas* canvas, unsigned int* picture return m_updateManager.paint(tile, canvas, pictureUsed); } -void TiledTexture::paintExtra(SkCanvas* canvas) -{ - m_surface->paintExtra(canvas); -} - const TransformationMatrix* TiledTexture::transform() { return m_surface->transform(); diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.h b/Source/WebCore/platform/graphics/android/TiledTexture.h index 206961b..c6e9e09 100644 --- a/Source/WebCore/platform/graphics/android/TiledTexture.h +++ b/Source/WebCore/platform/graphics/android/TiledTexture.h @@ -80,7 +80,6 @@ public: // TilePainter methods bool paint(BaseTile* tile, SkCanvas*, unsigned int*); - virtual void paintExtra(SkCanvas*); virtual const TransformationMatrix* transform(); float scale() { return m_scale; } diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 493d4b3..4c75b58 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -572,10 +572,6 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect, WebCore::In unsigned int pic = m_glWebViewState->currentPictureCounter(); m_glWebViewState->glExtras()->setDrawExtra(extra); - LayerAndroid* compositeLayer = compositeRoot(); - if (compositeLayer) - compositeLayer->setExtra(0); - SkRect visibleRect; calcOurContentVisibleRect(&visibleRect); // Make sure we have valid coordinates. We might not have valid coords @@ -650,28 +646,27 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, int extras, bool split) default: ; } +#if USE(ACCELERATED_COMPOSITING) + LayerAndroid* compositeLayer = compositeRoot(); + if (compositeLayer) { + SkRect visible; + calcOurContentVisibleRect(&visible); + // call this to be sure we've adjusted for any scrolling or animations + // before we actually draw + compositeLayer->updateFixedLayersPositions(visible); + compositeLayer->updatePositions(); + // We have to set the canvas' matrix on the base layer + // (to have fixed layers work as intended) + SkAutoCanvasRestore restore(canvas, true); + m_baseLayer->setMatrix(canvas->getTotalMatrix()); + canvas->resetMatrix(); + m_baseLayer->draw(canvas); + } +#endif if (extra) { IntRect dummy; // inval area, unused for now extra->draw(canvas, &mainPicture, &dummy); } -#if USE(ACCELERATED_COMPOSITING) - LayerAndroid* compositeLayer = compositeRoot(); - if (!compositeLayer) - return ret; - compositeLayer->setExtra(extra); - SkRect visible; - calcOurContentVisibleRect(&visible); - // call this to be sure we've adjusted for any scrolling or animations - // before we actually draw - compositeLayer->updateFixedLayersPositions(visible); - compositeLayer->updatePositions(); - // We have to set the canvas' matrix on the base layer - // (to have fixed layers work as intended) - SkAutoCanvasRestore restore(canvas, true); - m_baseLayer->setMatrix(canvas->getTotalMatrix()); - canvas->resetMatrix(); - m_baseLayer->draw(canvas); -#endif return ret; } |