summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/Android.mk1
-rw-r--r--Source/WebCore/platform/android/GeolocationServiceAndroid.cpp8
-rw-r--r--Source/WebCore/platform/android/GeolocationServiceAndroid.h21
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp4
-rw-r--r--Source/WebKit/Android.mk1
-rw-r--r--Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp11
-rw-r--r--Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h1
-rwxr-xr-xSource/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp21
-rw-r--r--Source/WebKit/android/WebCoreSupport/GeolocationPermissions.h11
-rw-r--r--Source/WebKit/android/jni/GeolocationServiceBridge.cpp (renamed from Source/WebCore/platform/android/GeolocationServiceBridge.cpp)27
-rw-r--r--Source/WebKit/android/jni/GeolocationServiceBridge.h (renamed from Source/WebCore/platform/android/GeolocationServiceBridge.h)31
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp6
-rw-r--r--Source/WebKit/android/nav/WebView.cpp90
-rw-r--r--ThirdPartyProject.prop13
-rw-r--r--WEBKIT_MERGE_REVISION5
17 files changed, 172 insertions, 83 deletions
diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk
index 742fade..677da4b 100644
--- a/Source/WebCore/Android.mk
+++ b/Source/WebCore/Android.mk
@@ -577,7 +577,6 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/android/FileChooserAndroid.cpp \
platform/android/FileSystemAndroid.cpp \
platform/android/GeolocationServiceAndroid.cpp \
- platform/android/GeolocationServiceBridge.cpp \
platform/android/KeyEventAndroid.cpp \
platform/android/LanguageAndroid.cpp \
platform/android/LocalizedStringsAndroid.cpp \
diff --git a/Source/WebCore/platform/android/GeolocationServiceAndroid.cpp b/Source/WebCore/platform/android/GeolocationServiceAndroid.cpp
index 0f07722..9ea0362 100644
--- a/Source/WebCore/platform/android/GeolocationServiceAndroid.cpp
+++ b/Source/WebCore/platform/android/GeolocationServiceAndroid.cpp
@@ -26,12 +26,14 @@
#include "config.h"
#include "GeolocationServiceAndroid.h"
+#include "Frame.h"
#include "Geolocation.h"
-#include "GeolocationServiceBridge.h"
#include "Geoposition.h"
#include "PositionError.h"
#include "PositionOptions.h"
+#include <WebViewCore.h>
+
#if PLATFORM(ANDROID)
// Required for sim-eng build
#include <math.h>
@@ -39,6 +41,8 @@
#include <wtf/CurrentTime.h>
using JSC::Bindings::getJNIEnv;
+using android::GeolocationServiceBridge;
+using android::WebViewCore;
using namespace std;
namespace WebCore {
@@ -89,7 +93,7 @@ bool GeolocationServiceAndroid::startUpdating(PositionOptions* options, bool sus
// Lazilly create the Java object.
bool haveJavaBridge = m_javaBridge;
if (!haveJavaBridge)
- m_javaBridge.set(new GeolocationServiceBridge(this, frame));
+ m_javaBridge.set(new GeolocationServiceBridge(this, WebViewCore::getWebViewCore(frame->view())));
ASSERT(m_javaBridge);
// On Android, high power == GPS. Set whether to use GPS before we start the
diff --git a/Source/WebCore/platform/android/GeolocationServiceAndroid.h b/Source/WebCore/platform/android/GeolocationServiceAndroid.h
index 72532f6..47c3ffe 100644
--- a/Source/WebCore/platform/android/GeolocationServiceAndroid.h
+++ b/Source/WebCore/platform/android/GeolocationServiceAndroid.h
@@ -28,37 +28,34 @@
#include "GeolocationService.h"
#include "Timer.h"
+
+#include <GeolocationServiceBridge.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
-// The GeolocationServiceBridge is the bridge to the Java implementation of
-// the Geolocation service. It is an implementation detail of
-// GeolocationServiceAndroid.
-class GeolocationServiceBridge;
-
-class GeolocationServiceAndroid : public GeolocationService {
+class GeolocationServiceAndroid : public GeolocationService, public android::GeolocationServiceBridge::Listener {
public:
static GeolocationService* create(GeolocationServiceClient*);
virtual ~GeolocationServiceAndroid() { };
+ // GeolocationService
// ANDROID
// TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
virtual bool startUpdating(PositionOptions*, bool suspend);
virtual void stopUpdating();
-
virtual Geoposition* lastPosition() const { return m_lastPosition.get(); }
virtual PositionError* lastError() const { return m_lastError.get(); }
-
virtual void suspend();
virtual void resume();
- // Android-specific
- void newPositionAvailable(PassRefPtr<Geoposition>);
- void newErrorAvailable(PassRefPtr<PositionError>);
+ // android::GeolocationServiceBridge::Listener
+ virtual void newPositionAvailable(PassRefPtr<Geoposition>);
+ virtual void newErrorAvailable(PassRefPtr<PositionError>);
+
void timerFired(Timer<GeolocationServiceAndroid>* timer);
private:
@@ -71,7 +68,7 @@ private:
Timer<GeolocationServiceAndroid> m_timer;
RefPtr<Geoposition> m_lastPosition;
RefPtr<PositionError> m_lastError;
- OwnPtr<GeolocationServiceBridge> m_javaBridge;
+ OwnPtr<android::GeolocationServiceBridge> m_javaBridge;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index f6be593..8caefbf 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -342,7 +342,7 @@ int GLWebViewState::drawGL(IntRect& invScreenRect, SkRect& visibleContentRect,
if (scale < MIN_SCALE_WARNING || scale > MAX_SCALE_WARNING) {
ALOGW("WARNING, scale seems corrupted after update: %e", scale);
- scale = 1.0f; // WORKAROUND for corrupted scale: use 1.0
+ CRASH();
}
// gather the textures we can use
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp
index bb5d990..944dc98 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContext.cpp
@@ -82,6 +82,8 @@ static bool setBitmapDash(SkPaint* paint, int width) {
s->setLocalMatrix(matrix);
paint->setShader(s)->unref();
+ paint->setFilterBitmap(true);
+ paint->setAntiAlias(true);
return true;
}
diff --git a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
index 0bd443b..e26fa9e 100644
--- a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
@@ -96,6 +96,10 @@ static bool setupForText(SkPaint* paint, GraphicsContext* gc,
float shadowBlur;
Color shadowColor;
ColorSpace shadowColorSpace;
+
+ if (RenderSkinAndroid::DrawableResolution() >= RenderSkinAndroid::HighRes)
+ paint->setAutohinted(false);
+
bool hasShadow = gc->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
bool hasBothStrokeAndFill =
(mode & (TextModeStroke | TextModeFill)) == (TextModeStroke | TextModeFill);
diff --git a/Source/WebKit/Android.mk b/Source/WebKit/Android.mk
index c3e9798..a27576b 100644
--- a/Source/WebKit/Android.mk
+++ b/Source/WebKit/Android.mk
@@ -61,6 +61,7 @@ LOCAL_SRC_FILES += \
android/jni/DeviceMotionClientImpl.cpp \
android/jni/DeviceOrientationClientImpl.cpp \
android/jni/GeolocationPermissionsBridge.cpp \
+ android/jni/GeolocationServiceBridge.cpp \
android/jni/JavaBridge.cpp \
android/jni/JavaSharedClient.cpp \
android/jni/MIMETypeRegistry.cpp \
diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index 907dc3c..e736087 100644
--- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -516,8 +516,9 @@ void ChromeClientAndroid::requestGeolocationPermissionForFrame(Frame* frame, Geo
{
ASSERT(geolocation);
if (!m_geolocationPermissions) {
- m_geolocationPermissions = new GeolocationPermissions(android::WebViewCore::getWebViewCore(frame->view()),
- m_webFrame->page()->mainFrame());
+ WebViewCore* webViewCore = android::WebViewCore::getWebViewCore(frame->view());
+ ASSERT(webViewCore->mainFrame() == m_webFrame->page()->mainFrame());
+ m_geolocationPermissions = new GeolocationPermissions(webViewCore);
}
m_geolocationPermissions->queryPermissionState(frame);
}
@@ -530,15 +531,9 @@ void ChromeClientAndroid::cancelGeolocationPermissionRequestForFrame(Frame* fram
void ChromeClientAndroid::provideGeolocationPermissions(const String &origin, bool allow, bool remember)
{
- ASSERT(m_geolocationPermissions);
m_geolocationPermissions->providePermissionState(origin, allow, remember);
}
-void ChromeClientAndroid::storeGeolocationPermissions()
-{
- GeolocationPermissions::maybeStorePermanentPermissions();
-}
-
void ChromeClientAndroid::onMainFrameLoadStarted()
{
if (m_geolocationPermissions.get())
diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 36576e6..8b509d5 100644
--- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -151,7 +151,6 @@ namespace android {
virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
// Android-specific
void provideGeolocationPermissions(const String &origin, bool allow, bool remember);
- void storeGeolocationPermissions();
void onMainFrameLoadStarted();
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
diff --git a/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp b/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp
index 36a9b61..fb29bd6 100755
--- a/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp
+++ b/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp
@@ -26,16 +26,16 @@
#include "config.h"
#include "GeolocationPermissions.h"
-#include "DOMWindow.h"
-#include "Frame.h"
-#include "Geolocation.h"
-#include "Navigator.h"
-#include "SQLiteDatabase.h"
-#include "SQLiteFileSystem.h"
-#include "SQLiteStatement.h"
-#include "SQLiteTransaction.h"
#include "WebViewCore.h"
+#include <DOMWindow.h>
+#include <Frame.h>
+#include <Geolocation.h>
+#include <Navigator.h>
+#include <SQLiteDatabase.h>
+#include <SQLiteFileSystem.h>
+#include <SQLiteStatement.h>
+#include <SQLiteTransaction.h>
#include <text/CString.h>
using namespace WebCore;
@@ -51,9 +51,8 @@ String GeolocationPermissions::s_databasePath;
static const char* databaseName = "GeolocationPermissions.db";
-GeolocationPermissions::GeolocationPermissions(WebViewCore* webViewCore, Frame* mainFrame)
+GeolocationPermissions::GeolocationPermissions(WebViewCore* webViewCore)
: m_webViewCore(webViewCore)
- , m_mainFrame(mainFrame)
, m_timer(this, &GeolocationPermissions::timerFired)
{
@@ -266,7 +265,7 @@ void GeolocationPermissions::maybeCallbackFrames(String origin, bool allow)
// or have their contents replaced. Even uniqueChildName is not unique when
// frames are dynamically deleted and created. Instead, we simply call back
// to the Geolocation object in all frames from the correct origin.
- for (Frame* frame = m_mainFrame; frame; frame = frame->tree()->traverseNext()) {
+ for (Frame* frame = m_webViewCore->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (origin == frame->document()->securityOrigin()->toString()) {
// If the page has changed, it may no longer have a Geolocation
// object.
diff --git a/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.h b/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.h
index fb31dfe..8f4b96e 100644
--- a/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.h
+++ b/Source/WebKit/android/WebCoreSupport/GeolocationPermissions.h
@@ -26,9 +26,8 @@
#ifndef GeolocationPermissions_h
#define GeolocationPermissions_h
-#include "PlatformString.h"
-#include "Timer.h"
-
+#include <PlatformString.h>
+#include <Timer.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/RefCounted.h>
@@ -63,9 +62,8 @@ namespace android {
class GeolocationPermissions : public RefCounted<GeolocationPermissions> {
public:
// Creates the GeolocationPermissions object to manage permissions for
- // the specified main frame (i.e. tab). The WebViewCore is used to
- // communicate with the browser to display UI.
- GeolocationPermissions(WebViewCore* webViewCore, WebCore::Frame* mainFrame);
+ // the WebView.
+ GeolocationPermissions(WebViewCore* webViewCore);
virtual ~GeolocationPermissions();
// Queries the permission state for the specified frame. If the
@@ -140,7 +138,6 @@ namespace android {
const WTF::String& nextOriginInQueue();
WebViewCore* m_webViewCore;
- WebCore::Frame* m_mainFrame;
// A vector of the origins queued to make a permission request.
// The first in the vector is the origin currently making the request.
typedef Vector<WTF::String> OriginVector;
diff --git a/Source/WebCore/platform/android/GeolocationServiceBridge.cpp b/Source/WebKit/android/jni/GeolocationServiceBridge.cpp
index 697b63b..044131f 100644
--- a/Source/WebCore/platform/android/GeolocationServiceBridge.cpp
+++ b/Source/WebKit/android/jni/GeolocationServiceBridge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2009, The Android Open Source Project
+ * Copyright 2012, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,16 +26,19 @@
#include "config.h"
#include "GeolocationServiceBridge.h"
-#include "Frame.h"
#include "GeolocationServiceAndroid.h"
-#include "Geoposition.h"
-#include "PositionError.h"
#include "WebViewCore.h"
-#include <JNIHelp.h>
-namespace WebCore {
+#include <Geoposition.h>
+#include <JNIHelp.h>
+#include <PositionError.h>
using JSC::Bindings::getJNIEnv;
+using WebCore::Coordinates;
+using WebCore::Geoposition;
+using WebCore::PositionError;
+
+namespace android {
static const char* javaGeolocationServiceClassName = "android/webkit/GeolocationService";
enum javaGeolocationServiceClassMethods {
@@ -71,12 +74,12 @@ enum javaLocationClassMethods {
};
static jmethodID javaLocationClassMethodIDs[LocationMethodCount];
-GeolocationServiceBridge::GeolocationServiceBridge(ListenerInterface* listener, Frame* frame)
+GeolocationServiceBridge::GeolocationServiceBridge(Listener* listener, WebViewCore* webViewCore)
: m_listener(listener)
, m_javaGeolocationServiceObject(0)
{
ASSERT(m_listener);
- startJavaImplementation(frame);
+ startJavaImplementation(webViewCore);
}
GeolocationServiceBridge::~GeolocationServiceBridge()
@@ -155,7 +158,7 @@ PassRefPtr<Geoposition> GeolocationServiceBridge::toGeoposition(JNIEnv *env, con
env->CallFloatMethod(location, javaLocationClassMethodIDs[LocationMethodGetSpeed]) :
0.0;
- RefPtr<Coordinates> newCoordinates = WebCore::Coordinates::create(
+ RefPtr<Coordinates> newCoordinates = Coordinates::create(
env->CallDoubleMethod(location, javaLocationClassMethodIDs[LocationMethodGetLatitude]),
env->CallDoubleMethod(location, javaLocationClassMethodIDs[LocationMethodGetLongitude]),
hasAltitude, Altitude,
@@ -164,12 +167,12 @@ PassRefPtr<Geoposition> GeolocationServiceBridge::toGeoposition(JNIEnv *env, con
hasHeading, heading,
hasSpeed, speed);
- return WebCore::Geoposition::create(
+ return Geoposition::create(
newCoordinates.release(),
env->CallLongMethod(location, javaLocationClassMethodIDs[LocationMethodGetTime]));
}
-void GeolocationServiceBridge::startJavaImplementation(Frame* frame)
+void GeolocationServiceBridge::startJavaImplementation(WebViewCore* webViewCore)
{
JNIEnv* env = getJNIEnv();
@@ -188,7 +191,7 @@ void GeolocationServiceBridge::startJavaImplementation(Frame* frame)
env->GetMethodID(javaGeolocationServiceClass, "setEnableGps", "(Z)V");
// Create the Java GeolocationService object.
- jobject context = android::WebViewCore::getWebViewCore(frame->view())->getContext();
+ jobject context = webViewCore->getContext();
if (!context)
return;
jlong nativeObject = reinterpret_cast<jlong>(this);
diff --git a/Source/WebCore/platform/android/GeolocationServiceBridge.h b/Source/WebKit/android/jni/GeolocationServiceBridge.h
index 3997d65..1813984 100644
--- a/Source/WebCore/platform/android/GeolocationServiceBridge.h
+++ b/Source/WebKit/android/jni/GeolocationServiceBridge.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2009, The Android Open Source Project
+ * Copyright 2012, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,22 +26,31 @@
#ifndef GeolocationServiceBridge_h
#define GeolocationServiceBridge_h
-#include "JNIUtility.h"
+#include <JNIUtility.h>
#include <wtf/PassRefPtr.h>
namespace WebCore {
-
-class Frame;
-class GeolocationServiceAndroid;
class Geoposition;
+class PositionError;
+}
+
+namespace android {
+
+class WebViewCore;
// GeolocationServiceBridge is the bridge to the Java implementation. It manages
// the lifetime of the Java object. It is an implementation detail of
// GeolocationServiceAndroid.
class GeolocationServiceBridge {
public:
- typedef GeolocationServiceAndroid ListenerInterface;
- GeolocationServiceBridge(ListenerInterface* listener, Frame* frame);
+ class Listener {
+ public:
+ virtual ~Listener() {}
+ virtual void newPositionAvailable(PassRefPtr<WebCore::Geoposition>) = 0;
+ virtual void newErrorAvailable(PassRefPtr<WebCore::PositionError>) = 0;
+ };
+
+ GeolocationServiceBridge(Listener*, WebViewCore*);
~GeolocationServiceBridge();
bool start();
@@ -51,16 +60,16 @@ public:
// Static wrapper functions to hide JNI nastiness.
static void newLocationAvailable(JNIEnv *env, jclass, jlong nativeObject, jobject location);
static void newErrorAvailable(JNIEnv *env, jclass, jlong nativeObject, jstring message);
- static PassRefPtr<Geoposition> toGeoposition(JNIEnv *env, const jobject &location);
+ static PassRefPtr<WebCore::Geoposition> toGeoposition(JNIEnv *env, const jobject &location);
private:
- void startJavaImplementation(Frame* frame);
+ void startJavaImplementation(WebViewCore*);
void stopJavaImplementation();
- ListenerInterface* m_listener;
+ Listener* m_listener;
jobject m_javaGeolocationServiceObject;
};
-} // namespace WebCore
+} // namespace android
#endif // GeolocationServiceBridge_h
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 8870b70..d0287b4 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -4770,11 +4770,9 @@ static void Pause(JNIEnv* env, jobject obj, jint nativeClass)
// browser). The browser can only be killed by the system when it is in the
// background, so saving the Geolocation permission state now ensures that
// is maintained when the browser is killed.
- WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass);
- ChromeClient* chromeClient = viewImpl->mainFrame()->page()->chrome()->client();
- ChromeClientAndroid* chromeClientAndroid = static_cast<ChromeClientAndroid*>(chromeClient);
- chromeClientAndroid->storeGeolocationPermissions();
+ GeolocationPermissions::maybeStorePermanentPermissions();
+ WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass);
Frame* mainFrame = viewImpl->mainFrame();
for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) {
Geolocation* geolocation = frame->domWindow()->navigator()->optionalGeolocation();
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 473efdb..fba5b58 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -650,6 +650,84 @@ void setDrawingPaused(bool isPaused)
m_viewImpl->setPrerenderingEnabled(!isPaused);
}
+// Finds the rectangles within world to the left, right, top, and bottom
+// of rect and adds them to rects. If no intersection exists, false is returned.
+static bool findMaskedRects(const FloatRect& world,
+ const FloatRect& rect, Vector<FloatRect>& rects) {
+ if (!world.intersects(rect))
+ return false; // nothing to subtract
+
+ // left rectangle
+ if (rect.x() > world.x())
+ rects.append(FloatRect(world.x(), world.y(),
+ rect.x() - world.x(), world.height()));
+ // top rectangle
+ if (rect.y() > world.y())
+ rects.append(FloatRect(world.x(), world.y(),
+ world.width(), rect.y() - world.y()));
+ // right rectangle
+ if (rect.maxX() < world.maxX())
+ rects.append(FloatRect(rect.maxX(), world.y(),
+ world.maxX() - rect.maxX(), world.height()));
+ // bottom rectangle
+ if (rect.maxY() < world.maxY())
+ rects.append(FloatRect(world.x(), rect.maxY(),
+ world.width(), world.maxY() - rect.maxY()));
+ return true;
+}
+
+// Returns false if layerId is a fixed position layer, otherwise
+// all fixed position layer rectangles are subtracted from those within
+// rects. Rects will be modified to contain rectangles that don't include
+// the fixed position layer rectangles.
+static bool findMaskedRectsForLayer(LayerAndroid* layer,
+ Vector<FloatRect>& rects, int layerId)
+{
+ if (layer->isPositionFixed()) {
+ if (layerId == layer->uniqueId())
+ return false;
+ FloatRect layerRect = layer->fullContentAreaMapped();
+ for (int i = rects.size() - 1; i >= 0; i--)
+ if (findMaskedRects(rects[i], layerRect, rects))
+ rects.remove(i);
+ }
+
+ int childIndex = 0;
+ while (LayerAndroid* child = layer->getChild(childIndex++))
+ if (!findMaskedRectsForLayer(child, rects, layerId))
+ return false;
+
+ return true;
+}
+
+// Finds the largest rectangle not masked by any fixed layer.
+void findMaxVisibleRect(int movingLayerId, SkIRect& visibleContentRect)
+{
+ if (!m_baseLayer)
+ return;
+
+ FloatRect visibleContentFloatRect(visibleContentRect);
+ m_baseLayer->updatePositionsRecursive(visibleContentFloatRect);
+ Vector<FloatRect> rects;
+ rects.append(visibleContentFloatRect);
+ if (findMaskedRectsForLayer(m_baseLayer, rects, movingLayerId)) {
+ float maxSize = 0.0;
+ const FloatRect* largest = 0;
+ for (int i = 0; i < rects.size(); i++) {
+ const FloatRect& rect = rects[i];
+ float size = rect.width() * rect.height();
+ if (size > maxSize) {
+ maxSize = size;
+ largest = &rect;
+ }
+ }
+ if (largest) {
+ SkRect largeRect = *largest;
+ largeRect.round(&visibleContentRect);
+ }
+ }
+}
+
private: // local state for WebView
bool m_isDrawingPaused;
// private to getFrameCache(); other functions operate in a different thread
@@ -1193,6 +1271,16 @@ static jint nativeSetHwAccelerated(JNIEnv *env, jobject obj, jint nativeView,
return webview->setHwAccelerated(hwAccelerated);
}
+static void nativeFindMaxVisibleRect(JNIEnv *env, jobject obj, jint nativeView,
+ jint movingLayerId, jobject visibleContentRect)
+{
+ WebView* webview = reinterpret_cast<WebView*>(nativeView);
+ SkIRect nativeRect;
+ GraphicsJNI::jrect_to_irect(env, visibleContentRect, &nativeRect);
+ webview->findMaxVisibleRect(movingLayerId, nativeRect);
+ GraphicsJNI::irect_to_jrect(nativeRect, env, visibleContentRect);
+}
+
/*
* JNI registration
*/
@@ -1269,6 +1357,8 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeMapLayerRect },
{ "nativeSetHwAccelerated", "(IZ)I",
(void*) nativeSetHwAccelerated },
+ { "nativeFindMaxVisibleRect", "(IILandroid/graphics/Rect;)V",
+ (void*) nativeFindMaxVisibleRect },
};
int registerWebView(JNIEnv* env)
diff --git a/ThirdPartyProject.prop b/ThirdPartyProject.prop
deleted file mode 100644
index ae9d227..0000000
--- a/ThirdPartyProject.prop
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2010 Google Inc. All Rights Reserved.
-#Fri Sep 10 11:49:27 BST 2010
-currentVersion=55486
-version=84325
-isNative=true
-name=webkit
-keywords=webkit
-onDevice=true
-homepage=http\://webkit.org/
-# Currently we track the Chromium 12.0.742 release branch:
-# http://trac.webkit.org/browser/branches/chromium/742
-# which is WebKit trunk r84325 plus stability cherry picks.
-webkit.chromiumRelease=http\://src.chromium.org/svn/releases/12.0.742.130/DEPS
diff --git a/WEBKIT_MERGE_REVISION b/WEBKIT_MERGE_REVISION
new file mode 100644
index 0000000..956ae85
--- /dev/null
+++ b/WEBKIT_MERGE_REVISION
@@ -0,0 +1,5 @@
+Currently we track the Chromium 12.0.742 release branch:
+http://trac.webkit.org/browser/branches/chromium/742
+which is WebKit trunk r84325 plus stability cherry picks.
+
+See also http://src.chromium.org/svn/releases/12.0.742.130/DEPS