summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTile.cpp24
-rw-r--r--Source/WebCore/platform/graphics/android/FontAndroid.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/MediaLayer.cpp3
-rw-r--r--Source/WebCore/platform/graphics/android/RasterRenderer.cpp23
-rw-r--r--Source/WebCore/platform/graphics/android/RasterRenderer.h2
-rw-r--r--Source/WebKit/android/WebCoreSupport/CacheResult.cpp11
-rw-r--r--Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp1
-rw-r--r--Source/WebKit/android/jni/CacheManager.cpp1
-rw-r--r--Source/WebKit/android/nav/SelectText.cpp13
-rw-r--r--Source/WebKit/android/nav/SelectText.h2
-rw-r--r--Source/WebKit/android/nav/WebView.cpp2
11 files changed, 68 insertions, 21 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp
index 98eb623..a331dfc 100644
--- a/Source/WebCore/platform/graphics/android/BaseTile.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp
@@ -183,6 +183,30 @@ void BaseTile::markAsDirty(int unsigned pictureCount,
m_lastDirtyPicture = pictureCount;
for (int i = 0; i < m_maxBufferNumber; i++)
m_dirtyArea[i].op(dirtyArea, SkRegion::kUnion_Op);
+
+ // Check if we actually intersect with the area
+ bool intersect = false;
+ SkRegion::Iterator cliperator(dirtyArea);
+ int tileWidth = TilesManager::instance()->tileWidth();
+ int tileHeight = TilesManager::instance()->tileHeight();
+ if (m_isLayerTile) {
+ tileWidth = TilesManager::instance()->layerTileWidth();
+ tileHeight = TilesManager::instance()->layerTileHeight();
+ }
+ SkRect realTileRect;
+ SkRect dirtyRect;
+ while (!cliperator.done()) {
+ dirtyRect.set(cliperator.rect());
+ if (intersectWithRect(m_x, m_y, tileWidth, tileHeight,
+ m_scale, dirtyRect, realTileRect)) {
+ intersect = true;
+ break;
+ }
+ cliperator.next();
+ }
+ if (!intersect)
+ return;
+
m_dirty = true;
if (m_state == UpToDate) {
// We only mark a tile as unpainted in 'markAsDirty' if its status is
diff --git a/Source/WebCore/platform/graphics/android/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/FontAndroid.cpp
index 852413f..e100955 100644
--- a/Source/WebCore/platform/graphics/android/FontAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/FontAndroid.cpp
@@ -52,6 +52,7 @@
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnArrayPtr.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/unicode/CharacterNames.h>
#include <wtf/unicode/Unicode.h>
#endif
@@ -881,10 +882,14 @@ void TextRunWalker::normalizeSpacesAndMirrorChars(const UChar* source, bool rtl,
UChar32 character;
int nextPosition = position;
U16_NEXT(source, nextPosition, length, character);
+
if (Font::treatAsSpace(character))
- character = ' ';
+ character = space;
+ else if (Font::treatAsZeroWidthSpace(character))
+ character = zeroWidthSpace;
else if (rtl)
character = u_charMirror(character);
+
U16_APPEND(destination, position, length, character, error);
ASSERT(!error);
position = nextPosition;
diff --git a/Source/WebCore/platform/graphics/android/MediaLayer.cpp b/Source/WebCore/platform/graphics/android/MediaLayer.cpp
index 7fa5ac2..0181892 100644
--- a/Source/WebCore/platform/graphics/android/MediaLayer.cpp
+++ b/Source/WebCore/platform/graphics/android/MediaLayer.cpp
@@ -68,7 +68,8 @@ MediaLayer::~MediaLayer()
bool MediaLayer::drawGL(GLWebViewState* glWebViewState, SkMatrix& matrix)
{
- TilesManager::instance()->shader()->clip(drawClip());
+ FloatRect clippingRect = TilesManager::instance()->shader()->rectInScreenCoord(drawClip());
+ TilesManager::instance()->shader()->clip(clippingRect);
// when the plugin gains focus webkit applies an outline to the
// widget, which causes the layer to expand to accommodate the
diff --git a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
index 8bf6fcc..0c92de4 100644
--- a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp
@@ -65,15 +65,20 @@ static const String TAGS[] = {
TAG_UPDATE_TEXTURE,
};
+SkBitmap* RasterRenderer::g_bitmap = 0;
+
RasterRenderer::RasterRenderer() : BaseRenderer(BaseRenderer::Raster)
{
#ifdef DEBUG_COUNT
ClassTracker::instance()->increment("RasterRenderer");
#endif
- m_bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- TilesManager::instance()->tileWidth(),
- TilesManager::instance()->tileHeight());
- m_bitmap.allocPixels();
+ if (!g_bitmap) {
+ g_bitmap = new SkBitmap();
+ g_bitmap->setConfig(SkBitmap::kARGB_8888_Config,
+ TilesManager::instance()->tileWidth(),
+ TilesManager::instance()->tileHeight());
+ g_bitmap->allocPixels();
+ }
}
RasterRenderer::~RasterRenderer()
@@ -89,14 +94,14 @@ void RasterRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can
m_perfMon.start(TAG_CREATE_BITMAP);
if (renderInfo.baseTile->isLayerTile()) {
- m_bitmap.setIsOpaque(false);
- m_bitmap.eraseARGB(0, 0, 0, 0);
+ g_bitmap->setIsOpaque(false);
+ g_bitmap->eraseARGB(0, 0, 0, 0);
} else {
- m_bitmap.setIsOpaque(true);
- m_bitmap.eraseARGB(255, 255, 255, 255);
+ g_bitmap->setIsOpaque(true);
+ g_bitmap->eraseARGB(255, 255, 255, 255);
}
- SkDevice* device = new SkDevice(NULL, m_bitmap, false);
+ SkDevice* device = new SkDevice(NULL, *g_bitmap, false);
if (renderInfo.measurePerf) {
m_perfMon.stop(TAG_CREATE_BITMAP);
diff --git a/Source/WebCore/platform/graphics/android/RasterRenderer.h b/Source/WebCore/platform/graphics/android/RasterRenderer.h
index 69dfaf8..96b3f58 100644
--- a/Source/WebCore/platform/graphics/android/RasterRenderer.h
+++ b/Source/WebCore/platform/graphics/android/RasterRenderer.h
@@ -52,7 +52,7 @@ protected:
virtual const String* getPerformanceTags(int& tagCount);
private:
- SkBitmap m_bitmap;
+ static SkBitmap* g_bitmap;
};
diff --git a/Source/WebKit/android/WebCoreSupport/CacheResult.cpp b/Source/WebKit/android/WebCoreSupport/CacheResult.cpp
index 5309c66..6710e49 100644
--- a/Source/WebKit/android/WebCoreSupport/CacheResult.cpp
+++ b/Source/WebKit/android/WebCoreSupport/CacheResult.cpp
@@ -134,11 +134,11 @@ bool CacheResult::writeToFile(const String& filePath) const
if (!thread)
return false;
- CacheResult* me = const_cast<CacheResult*>(this);
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::writeToFileImpl));
-
m_filePath = filePath.threadsafeCopy();
m_isAsyncOperationInProgress = true;
+
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::writeToFileImpl));
+
while (m_isAsyncOperationInProgress)
m_condition.wait(m_mutex);
@@ -213,10 +213,9 @@ HttpResponseHeaders* CacheResult::responseHeaders() const
if (!thread)
return 0;
- CacheResult* me = const_cast<CacheResult*>(this);
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::responseHeadersImpl));
-
m_isAsyncOperationInProgress = true;
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::responseHeadersImpl));
+
while (m_isAsyncOperationInProgress)
m_condition.wait(m_mutex);
diff --git a/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp b/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp
index 260c76e..1857e9c 100644
--- a/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp
+++ b/Source/WebKit/android/WebCoreSupport/WebViewClientError.cpp
@@ -79,6 +79,7 @@ WebViewClientError ToWebViewClientError(net::Error error) {
case ERR_CONNECTION_ABORTED:
case ERR_CONNECTION_FAILED:
case ERR_SOCKET_NOT_CONNECTED:
+ case ERR_CACHE_MISS:
return ERROR_CONNECT;
case ERR_ADDRESS_INVALID:
diff --git a/Source/WebKit/android/jni/CacheManager.cpp b/Source/WebKit/android/jni/CacheManager.cpp
index 144b62a..f600d00 100644
--- a/Source/WebKit/android/jni/CacheManager.cpp
+++ b/Source/WebKit/android/jni/CacheManager.cpp
@@ -90,6 +90,7 @@ static jobject getCacheResult(JNIEnv* env, jobject, jstring url)
String urlWtfString = jstringToWtfString(env, url);
Vector<char> encodedUrl;
base64Encode(urlWtfString.utf8().data(), urlWtfString.length(), encodedUrl, false /*insertLFs*/);
+ encodedUrl.append('\0');
String filePath = pathByAppendingComponent(getCacheFileBaseDir(env), encodedUrl.data());
if (!result->writeToFile(filePath))
return 0;
diff --git a/Source/WebKit/android/nav/SelectText.cpp b/Source/WebKit/android/nav/SelectText.cpp
index 4a6b509..d20c44a 100644
--- a/Source/WebKit/android/nav/SelectText.cpp
+++ b/Source/WebKit/android/nav/SelectText.cpp
@@ -1829,12 +1829,23 @@ bool SelectText::hitSelection(int x, int y) const
return m_selRegion.contains(x, y);
}
-void SelectText::getSelectionHandles(int* handles)
+void SelectText::getSelectionHandles(int* handles, LayerAndroid* root)
{
handles[0] = m_selStart.fLeft;
handles[1] = m_selStart.fBottom;
handles[2] = m_selEnd.fRight;
handles[3] = m_selEnd.fBottom;
+ if (root && m_layerId) {
+ Layer* layer = root->findById(m_layerId);
+ while (layer) {
+ const SkPoint& pos = layer->getPosition();
+ handles[0] += pos.fX;
+ handles[2] += pos.fX;
+ handles[1] += pos.fY;
+ handles[3] += pos.fY;
+ layer = layer->getParent();
+ }
+ }
}
void SelectText::moveSelection(const IntRect& vis, int x, int y)
diff --git a/Source/WebKit/android/nav/SelectText.h b/Source/WebKit/android/nav/SelectText.h
index 4abf378..b454b8e 100644
--- a/Source/WebKit/android/nav/SelectText.h
+++ b/Source/WebKit/android/nav/SelectText.h
@@ -59,7 +59,7 @@ public:
bool wordSelection(const CachedRoot* , const IntRect& vis, int x, int y);
void getSelectionRegion(const IntRect& vis, SkRegion *region, LayerAndroid* root);
void updateHandleScale(float handleScale);
- void getSelectionHandles(int* handles);
+ void getSelectionHandles(int* handles, LayerAndroid* root);
public:
float m_inverseScale; // inverse scale, x, y used for drawing select path
int m_selectX;
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 59fd6da..aea28bd 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -1505,7 +1505,7 @@ void getTextSelectionRegion(SkRegion *region)
void getTextSelectionHandles(int* handles)
{
- m_selectText.getSelectionHandles(handles);
+ m_selectText.getSelectionHandles(handles, compositeRoot());
}
void replaceBaseContent(PictureSet* set)