diff options
Diffstat (limited to 'Source')
6 files changed, 11 insertions, 17 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp index b5c0f0a..d15feeb 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp @@ -48,7 +48,6 @@ namespace WebCore { BaseTile::BaseTile(bool isLayerTile) : m_glWebViewState(0) - , m_painter(0) , m_x(-1) , m_y(-1) , m_page(0) @@ -85,11 +84,10 @@ BaseTile::~BaseTile() // All the following functions must be called from the main GL thread. -void BaseTile::setContents(TilePainter* painter, int x, int y, float scale) +void BaseTile::setContents(int x, int y, float scale) { // TODO: investigate whether below check/discard is necessary - if (!painter - || (m_x != x) + if ((m_x != x) || (m_y != y) || (m_scale != scale)) { // neither texture is relevant @@ -97,7 +95,6 @@ void BaseTile::setContents(TilePainter* painter, int x, int y, float scale) } android::AutoMutex lock(m_atomicSync); - m_painter = painter; m_x = x; m_y = y; m_scale = scale; @@ -288,7 +285,7 @@ bool BaseTile::isTileVisible(const IntRect& viewTileBounds) } // This is called from the texture generation thread -void BaseTile::paintBitmap() +void BaseTile::paintBitmap(TilePainter* painter) { // We acquire the values below atomically. This ensures that we are reading // values correctly across cores. Further, once we have these values they @@ -300,7 +297,6 @@ void BaseTile::paintBitmap() float scale = m_scale; const int x = m_x; const int y = m_y; - TilePainter* painter = m_painter; if (!dirty || !texture) { m_atomicSync.unlock(); diff --git a/Source/WebCore/platform/graphics/android/BaseTile.h b/Source/WebCore/platform/graphics/android/BaseTile.h index f02386b..ab16dc9 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.h +++ b/Source/WebCore/platform/graphics/android/BaseTile.h @@ -94,7 +94,7 @@ public: bool isLayerTile() { return m_isLayerTile; } - void setContents(TilePainter* painter, int x, int y, float scale); + void setContents(int x, int y, float scale); void setPage(TiledPage* page) { m_page = page; } void reserveTexture(); @@ -105,7 +105,7 @@ public: const TransformationMatrix* transform); // the only thread-safe function called by the background thread - void paintBitmap(); + void paintBitmap(TilePainter* painter); bool intersectWithRect(int x, int y, int tileWidth, int tileHeight, float scale, const SkRect& dirtyRect, @@ -138,14 +138,12 @@ public: virtual bool removeTexture(BaseTileTexture* texture); virtual TiledPage* page() { return m_page; } virtual GLWebViewState* state() { return m_glWebViewState; } - TilePainter* painter() { return m_painter; } private: void validatePaint(); GLWebViewState* m_glWebViewState; - TilePainter* m_painter; int m_x; int m_y; diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp index a79298c..1fcb765 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.cpp @@ -67,7 +67,7 @@ bool PaintTileOperation::operator==(const QueuedOperation* operation) void PaintTileOperation::run() { if (m_tile) { - m_tile->paintBitmap(); + m_tile->paintBitmap(m_painter); m_tile->setRepaintPending(false); m_tile = 0; } diff --git a/Source/WebCore/platform/graphics/android/PaintTileOperation.h b/Source/WebCore/platform/graphics/android/PaintTileOperation.h index 4e98287..05825e2 100644 --- a/Source/WebCore/platform/graphics/android/PaintTileOperation.h +++ b/Source/WebCore/platform/graphics/android/PaintTileOperation.h @@ -38,13 +38,13 @@ class ImageTexture; class PaintTileOperation : public QueuedOperation { public: - PaintTileOperation(BaseTile* tile, TilePainter* painter = 0); + PaintTileOperation(BaseTile* tile, TilePainter* painter); virtual ~PaintTileOperation(); virtual bool operator==(const QueuedOperation* operation); virtual void run(); // returns a rendering priority for m_tile, lower values are processed faster virtual int priority(); - TilePainter* painter() { return m_tile->painter(); } + TilePainter* painter() { return m_painter; } float scale() { return m_tile->scale(); } private: diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp index df740e7..afa2014 100644 --- a/Source/WebCore/platform/graphics/android/TiledPage.cpp +++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp @@ -171,7 +171,7 @@ void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y currentTile->setGLWebViewState(m_glWebViewState); currentTile->setPage(this); - currentTile->setContents(this, x, y, m_scale); + currentTile->setContents(x, y, m_scale); // TODO: move below (which is largely the same for layers / tiled // page) into prepare() function @@ -183,7 +183,7 @@ void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y if (currentTile->backTexture() && currentTile->isDirty() && !currentTile->isRepaintPending()) { - PaintTileOperation *operation = new PaintTileOperation(currentTile); + PaintTileOperation *operation = new PaintTileOperation(currentTile, this); TilesManager::instance()->scheduleOperation(operation); } } diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp index 9ce6f6d..039e28c 100644 --- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp +++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp @@ -168,7 +168,7 @@ void TiledTexture::prepareTile(int x, int y, TilePainter* painter) } ALOGV("preparing tile %p at %d, %d, painter is %p", tile, x, y, painter); - tile->setContents(painter, x, y, m_scale); + tile->setContents(x, y, m_scale); // TODO: move below (which is largely the same for layers / tiled page) into // prepareGL() function |