summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp13
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp11
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp2
5 files changed, 25 insertions, 9 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/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
index 5ce63bf..63f73aa 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
@@ -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)
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,