diff options
-rw-r--r-- | WebCore/platform/graphics/android/BaseTile.cpp | 13 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 15 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/TiledPage.cpp | 3 |
3 files changed, 20 insertions, 11 deletions
diff --git a/WebCore/platform/graphics/android/BaseTile.cpp b/WebCore/platform/graphics/android/BaseTile.cpp index 4400ea5..c67e2b8 100644 --- a/WebCore/platform/graphics/android/BaseTile.cpp +++ b/WebCore/platform/graphics/android/BaseTile.cpp @@ -32,6 +32,7 @@ #include "SkBitmap.h" #include "SkBitmapRef.h" #include "SkCanvas.h" +#include "SkPicture.h" #include "TilesManager.h" #include <EGL/egl.h> @@ -420,11 +421,13 @@ int BaseTile::paintPartialBitmap(SkIRect r, float ptx, float pty, SkCanvas canvas(bitmap); canvas.drawARGB(255, 255, 255, 255); - canvas.save(); - canvas.scale(scale, scale); - canvas.translate(tx, ty); - int pictureCount = tiledPage->paintBaseLayerContent(&canvas); - canvas.restore(); + SkPicture picture; + SkCanvas* nCanvas = picture.beginRecording(rect.width(), rect.height()); + nCanvas->scale(scale, scale); + nCanvas->translate(tx, ty); + int pictureCount = tiledPage->paintBaseLayerContent(nCanvas); + picture.endRecording(); + picture.draw(&canvas); if (TilesManager::instance()->getShowVisualIndicator()) { int color = 20 + pictureCount % 100; diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 33d98ea..0f2faa0 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -1014,13 +1014,16 @@ void LayerAndroid::paintBitmapGL() float scale = texture->scale(); IntRect textureRect = texture->rect(); - - canvas->save(); canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); - canvas->scale(scale, scale); - canvas->translate(-textureRect.x(), -textureRect.y()); - contentDraw(canvas); - canvas->restore(); + + SkPicture picture; + SkCanvas* nCanvas = picture.beginRecording(textureRect.width(), + textureRect.height()); + nCanvas->scale(scale, scale); + nCanvas->translate(-textureRect.x(), -textureRect.y()); + contentDraw(nCanvas); + picture.endRecording(); + picture.draw(canvas); m_atomicSync.lock(); texture->setTextureInfoFor(this); diff --git a/WebCore/platform/graphics/android/TiledPage.cpp b/WebCore/platform/graphics/android/TiledPage.cpp index a400a4a..4fa3e0e 100644 --- a/WebCore/platform/graphics/android/TiledPage.cpp +++ b/WebCore/platform/graphics/android/TiledPage.cpp @@ -151,6 +151,9 @@ void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y else x += i; + if (x < 0) + continue; + BaseTile* currentTile = 0; BaseTile* availableTile = 0; for (int j = 0; j < m_baseTileSize; j++) { |