summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/jni/WebFrameView.cpp2
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp40
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h135
-rw-r--r--Source/WebKit/android/nav/SelectText.h3
-rw-r--r--Source/WebKit/android/nav/WebView.cpp67
5 files changed, 171 insertions, 76 deletions
diff --git a/Source/WebKit/android/jni/WebFrameView.cpp b/Source/WebKit/android/jni/WebFrameView.cpp
index f30e5b7..10e31dc 100644
--- a/Source/WebKit/android/jni/WebFrameView.cpp
+++ b/Source/WebKit/android/jni/WebFrameView.cpp
@@ -61,7 +61,7 @@ void WebFrameView::draw(WebCore::GraphicsContext* gc, const WebCore::IntRect& re
mFrameView->paintContents(gc, rect);
else {
// FIXME: I'm not entirely sure this ever happens or is needed
- gc->setFillColor(Color::white, ColorSpaceDeviceRGB);
+ gc->setFillColor(WebCore::Color::white, WebCore::ColorSpaceDeviceRGB);
gc->fillRect(rect);
}
}
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index bb76c80..3fc17e3 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1667,10 +1667,50 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection)
selectTextContainer->setCaretRect(SelectText::EndHandle, endHandle);
selectTextContainer->setText(range->text());
+ selectTextContainer->setTextRect(SelectText::StartHandle,
+ positionToTextRect(selection.start()));
+ selectTextContainer->setTextRect(SelectText::EndHandle,
+ positionToTextRect(selection.end()));
return selectTextContainer;
}
+IntRect WebViewCore::positionToTextRect(const Position& position)
+{
+ IntRect textRect;
+ InlineBox* inlineBox;
+ int offset;
+ position.getInlineBoxAndOffset(VP_DEFAULT_AFFINITY, inlineBox, offset);
+ if (inlineBox && inlineBox->isInlineTextBox()) {
+ InlineTextBox* box = static_cast<InlineTextBox*>(inlineBox);
+ RootInlineBox* root = box->root();
+ RenderText* renderText = box->textRenderer();
+ int left = root->logicalLeft();
+ int width = root->logicalWidth();
+ int top = root->selectionTop();
+ int height = root->selectionHeight();
+
+ Node* node = position.anchorNode();
+ LayerAndroid* layer = 0;
+ int layerId = platformLayerIdFromNode(node, &layer);
+ IntPoint layerOffset;
+ layerToAbsoluteOffset(layer, layerOffset);
+
+ if (!renderText->style()->isHorizontalWritingMode()) {
+ swap(left, top);
+ swap(width, height);
+ }
+ FloatPoint origin(left, top);
+ FloatPoint absoluteOrigin = renderText->localToAbsolute(origin);
+
+ textRect.setX(absoluteOrigin.x() - layerOffset.x());
+ textRect.setWidth(width);
+ textRect.setY(absoluteOrigin.y() - layerOffset.y());
+ textRect.setHeight(height);
+ }
+ return textRect;
+}
+
IntPoint WebViewCore::convertGlobalContentToFrameContent(const IntPoint& point, WebCore::Frame* frame)
{
if (!frame) frame = focusedFrame();
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index 479f549..5926991 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -85,9 +85,6 @@ class SkPicture;
class SkIRect;
namespace android {
- // TODO: This file hasn't been good about namespace. Remove this temporary
- // workaround to build
- using namespace WebCore;
enum Direction {
DIRECTION_BACKWARD = 0,
@@ -174,7 +171,7 @@ namespace android {
void layersDraw();
#if USE(ACCELERATED_COMPOSITING)
- GraphicsLayerAndroid* graphicsRootLayer() const;
+ WebCore::GraphicsLayerAndroid* graphicsRootLayer() const;
#endif
/** Invalidate the view/screen, NOT the content/DOM, but expressed in
@@ -214,7 +211,7 @@ namespace android {
* Tell the java side to update the focused textfield
* @param pointer Pointer to the node for the input field.
* @param changeToPassword If true, we are changing the textfield to
- * a password field, and ignore the String
+ * a password field, and ignore the WTF::String
* @param text If changeToPassword is false, this is the new text that
* should go into the textfield.
*/
@@ -290,12 +287,13 @@ namespace android {
jobject getDeviceMotionService();
jobject getDeviceOrientationService();
- void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID, int msgLevel);
+ void addMessageToConsole(const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID, int msgLevel);
/**
* Tell the Java side of the scrollbar mode
*/
- void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode);
+ void setScrollbarModes(WebCore::ScrollbarMode horizontalMode,
+ WebCore::ScrollbarMode verticalMode);
//
// Followings support calls from Java to native WebCore
@@ -310,7 +308,7 @@ namespace android {
// scroll the selection on screen (if necessary).
void revealSelection();
- void moveMouse(int x, int y, HitTestResult* hoveredNode = 0);
+ void moveMouse(int x, int y, WebCore::HitTestResult* hoveredNode = 0);
// set the scroll amount that webview.java is currently showing
void setScrollOffset(bool sendScrollEvent, int dx, int dy);
@@ -326,8 +324,8 @@ namespace android {
* @return Whether keyCode was handled by this class.
*/
bool key(const WebCore::PlatformKeyboardEvent& event);
- bool chromeCanTakeFocus(FocusDirection direction);
- void chromeTakeFocus(FocusDirection direction);
+ bool chromeCanTakeFocus(WebCore::FocusDirection direction);
+ void chromeTakeFocus(WebCore::FocusDirection direction);
/**
* Handle (trackball) click event / dpad center press from Java.
@@ -339,7 +337,9 @@ namespace android {
/**
* Handle touch event
*/
- bool handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int actionIndex, int metaState);
+ bool handleTouchEvent(int action, WTF::Vector<int>& ids,
+ WTF::Vector<WebCore::IntPoint>& points,
+ int actionIndex, int metaState);
/**
* Handle motionUp event from the UI thread (called touchUp in the
@@ -382,11 +382,11 @@ namespace android {
* direction - The direction in which to alter the selection.
* granularity - The granularity of the selection modification.
*
- * returns - The selected HTML as a string. This is not a well formed
+ * returns - The selected HTML as a WTF::String. This is not a well formed
* HTML, rather the selection annotated with the tags of all
* intermediary elements it crosses.
*/
- String modifySelection(const int direction, const int granularity);
+ WTF::String modifySelection(const int direction, const int granularity);
/**
* Moves the selection to the given node in a given frame i.e. selects that node.
@@ -396,11 +396,11 @@ namespace android {
* frame - The frame in which to select is the node to be selected.
* node - The node to be selected.
*
- * returns - The selected HTML as a string. This is not a well formed
+ * returns - The selected HTML as a WTF::String. This is not a well formed
* HTML, rather the selection annotated with the tags of all
* intermediary elements it crosses.
*/
- String moveSelection(WebCore::Frame* frame, WebCore::Node* node);
+ WTF::String moveSelection(WebCore::Frame* frame, WebCore::Node* node);
/**
* In the currently focused textfield, replace the characters from oldStart to oldEnd
@@ -457,7 +457,7 @@ namespace android {
void sendPluginSurfaceReady();
// send onLoad event to plugins who are descendents of the given frame
- void notifyPluginsOnFrameLoad(const Frame*);
+ void notifyPluginsOnFrameLoad(const WebCore::Frame*);
// gets a rect representing the current on-screen portion of the document
void getVisibleScreen(ANPRectI&);
@@ -515,11 +515,11 @@ namespace android {
void centerFitRect(int x, int y, int width, int height);
// return a list of rects matching the touch point (x, y) with the slop
- Vector<IntRect> getTouchHighlightRects(int x, int y, int slop,
- Node** node, HitTestResult* hitTestResult);
+ WTF::Vector<WebCore::IntRect> getTouchHighlightRects(int x, int y, int slop,
+ WebCore::Node** node, WebCore::HitTestResult* hitTestResult);
// This does a sloppy hit test
AndroidHitTestResult hitTestAtPoint(int x, int y, int slop, bool doMoveMouse = false);
- static bool nodeIsClickableOrFocusable(Node* node);
+ static bool nodeIsClickableOrFocusable(WebCore::Node* node);
// Open a file chooser for selecting a file to upload
void openFileChooser(PassRefPtr<WebCore::FileChooser> );
@@ -530,13 +530,13 @@ namespace android {
bool focusBoundsChanged();
// record the inval area, and the picture size
- BaseLayerAndroid* recordContent(SkRegion* , SkIPoint* );
+ WebCore::BaseLayerAndroid* recordContent(SkRegion* , SkIPoint* );
// This creates a new BaseLayerAndroid by copying the current m_content
// and doing a copy of the layers. The layers' content may be updated
// as we are calling layersSync().
- BaseLayerAndroid* createBaseLayer(SkRegion*);
- bool updateLayers(LayerAndroid*);
+ WebCore::BaseLayerAndroid* createBaseLayer(SkRegion*);
+ bool updateLayers(WebCore::LayerAndroid*);
void notifyAnimationStarted();
int textWrapWidth() const { return m_textWrapWidth; }
@@ -600,14 +600,16 @@ namespace android {
*/
Vector<WebCore::VisibleSelection> getTextRanges(
int startX, int startY, int endX, int endY);
- static int platformLayerIdFromNode(Node* node, LayerAndroid** outLayer = 0);
+ static int platformLayerIdFromNode(WebCore::Node* node,
+ WebCore::LayerAndroid** outLayer = 0);
void selectText(int startX, int startY, int endX, int endY);
bool selectWordAt(int x, int y);
// Converts from the global content coordinates that WebView sends
// to frame-local content coordinates using the focused frame
- IntPoint convertGlobalContentToFrameContent(const IntPoint& point, WebCore::Frame* frame = 0);
- static void layerToAbsoluteOffset(const LayerAndroid* layer, IntPoint& offset);
+ WebCore::IntPoint convertGlobalContentToFrameContent(const WebCore::IntPoint& point, WebCore::Frame* frame = 0);
+ static void layerToAbsoluteOffset(const WebCore::LayerAndroid* layer,
+ WebCore::IntPoint& offset);
/**
* Returns a text position at a given coordinate.
@@ -615,7 +617,7 @@ namespace android {
WebCore::VisiblePosition visiblePositionForWindowPoint(int x, int y);
// Retrieves the current locale from system properties
- void getLocale(String& language, String& region);
+ void getLocale(String& language, WTF::String& region);
// Handles changes in system locale
void updateLocale();
@@ -660,28 +662,38 @@ namespace android {
const WebCore::QualifiedName& );
WebCore::HTMLImageElement* retrieveImageElement(int x, int y);
// below are members responsible for accessibility support
- String modifySelectionTextNavigationAxis(DOMSelection* selection, int direction, int granularity);
- String modifySelectionDomNavigationAxis(DOMSelection* selection, int direction, int granularity);
- Text* traverseNextContentTextNode(Node* fromNode, Node* toNode ,int direction);
- bool isVisible(Node* node);
- bool isHeading(Node* node);
- String formatMarkup(DOMSelection* selection);
+ WTF::String modifySelectionTextNavigationAxis(WebCore::DOMSelection* selection,
+ int direction, int granularity);
+ WTF::String modifySelectionDomNavigationAxis(WebCore::DOMSelection* selection,
+ int direction, int granularity);
+ WebCore::Text* traverseNextContentTextNode(WebCore::Node* fromNode,
+ WebCore::Node* toNode,
+ int direction);
+ bool isVisible(WebCore::Node* node);
+ bool isHeading(WebCore::Node* node);
+ WTF::String formatMarkup(WebCore::DOMSelection* selection);
void selectAt(int x, int y);
- void scrollNodeIntoView(Frame* frame, Node* node);
- bool isContentTextNode(Node* node);
- Node* getIntermediaryInputElement(Node* fromNode, Node* toNode, int direction);
- bool isContentInputElement(Node* node);
- bool isDescendantOf(Node* parent, Node* node);
- void advanceAnchorNode(DOMSelection* selection, int direction, String& markup, bool ignoreFirstNode, ExceptionCode& ec);
- Node* getNextAnchorNode(Node* anchorNode, bool skipFirstHack, int direction);
- Node* getImplicitBoundaryNode(Node* node, unsigned offset, int direction);
- jobject createTextFieldInitData(Node* node);
+ void scrollNodeIntoView(WebCore::Frame* frame, WebCore::Node* node);
+ bool isContentTextNode(WebCore::Node* node);
+ WebCore::Node* getIntermediaryInputElement(WebCore::Node* fromNode,
+ WebCore::Node* toNode,
+ int direction);
+ bool isContentInputElement(WebCore::Node* node);
+ bool isDescendantOf(WebCore::Node* parent, WebCore::Node* node);
+ void advanceAnchorNode(WebCore::DOMSelection* selection, int direction,
+ WTF::String& markup, bool ignoreFirstNode,
+ WebCore::ExceptionCode& ec);
+ WebCore::Node* getNextAnchorNode(WebCore::Node* anchorNode,
+ bool skipFirstHack, int direction);
+ WebCore::Node* getImplicitBoundaryNode(WebCore::Node* node,
+ unsigned offset, int direction);
+ jobject createTextFieldInitData(WebCore::Node* node);
/**
* Calls into java to reset the text edit field with the
* current contents and selection.
*/
- void initEditField(Node* node);
+ void initEditField(WebCore::Node* node);
/**
* If node is not a text input field or if it explicitly requests
@@ -689,55 +701,58 @@ namespace android {
* it is a text input field then initEditField is called and
* auto-fill information is requested for HTML form input fields.
*/
- void initializeTextInput(Node* node, bool fake = false);
+ void initializeTextInput(WebCore::Node* node, bool fake = false);
/**
* Gets the input type a Node. NONE is returned if it isn't an
* input field.
*/
- InputType getInputType(Node* node);
+ InputType getInputType(WebCore::Node* node);
/**
* If node is an input field, the spellcheck value for the
* field is returned. Otherwise true is returned.
*/
- static bool isSpellCheckEnabled(Node* node);
+ static bool isSpellCheckEnabled(WebCore::Node* node);
/**
* Returns the offsets of the selection area for both normal text
* fields and content editable fields. start and end are modified
* by this method.
*/
- static void getSelectionOffsets(Node* node, int& start, int& end);
+ static void getSelectionOffsets(WebCore::Node* node, int& start, int& end);
/**
* Gets the plain text of the specified editable text field. node
* may be content-editable or a plain text fields.
*/
- static String getInputText(Node* node);
+ static WTF::String getInputText(WebCore::Node* node);
/**
* Gets the RenderTextControl for the given node if it has one.
* If its renderer isn't a RenderTextControl, then NULL is returned.
*/
- static RenderTextControl* toRenderTextControl(Node *node);
+ static WebCore::RenderTextControl* toRenderTextControl(WebCore::Node *node);
/**
* Sets the selection for node's editable field to the offsets
* between start (inclusive) and end (exclusive).
*/
- static void setSelection(Node* node, int start, int end);
+ static void setSelection(WebCore::Node* node, int start, int end);
/**
* Returns the Position for the given offset for an editable
* field. The offset is relative to the node start.
*/
- static WebCore::Position getPositionForOffset(Node* node, int offset);
+ static WebCore::Position getPositionForOffset(WebCore::Node* node, int offset);
- VisiblePosition visiblePositionForContentPoint(int x, int y);
- VisiblePosition visiblePositionForContentPoint(const IntPoint& point);
- bool selectWordAroundPosition(Frame* frame, VisiblePosition pos);
- SelectText* createSelectText(const VisibleSelection&);
- static int getMaxLength(Node* node);
- static String getFieldName(Node* node);
- static bool isAutoCompleteEnabled(Node* node);
- IntRect boundingRect(Node* node, LayerAndroid* layer);
+ WebCore::VisiblePosition visiblePositionForContentPoint(int x, int y);
+ WebCore::VisiblePosition visiblePositionForContentPoint(const WebCore::IntPoint& point);
+ bool selectWordAroundPosition(WebCore::Frame* frame,
+ WebCore::VisiblePosition pos);
+ SelectText* createSelectText(const WebCore::VisibleSelection&);
+ static int getMaxLength(WebCore::Node* node);
+ static WTF::String getFieldName(WebCore::Node* node);
+ static bool isAutoCompleteEnabled(WebCore::Node* node);
+ WebCore::IntRect boundingRect(WebCore::Node* node,
+ WebCore::LayerAndroid* layer);
+ static WebCore::IntRect positionToTextRect(const WebCore::Position& position);
// called from constructor, to add this to a global list
static void addInstance(WebViewCore*);
@@ -773,7 +788,7 @@ namespace android {
int m_screenHeight;// height of the visible rect in document coordinates
int m_textWrapWidth;
float m_scale;
- PageGroup* m_groupForVisitedLinks;
+ WebCore::PageGroup* m_groupForVisitedLinks;
bool m_isPaused;
int m_cacheMode;
bool m_fullscreenVideoMode;
@@ -791,7 +806,7 @@ namespace android {
}
int m_screenOnCounter;
- Node* m_currentNodeDomNavigationAxis;
+ WebCore::Node* m_currentNodeDomNavigationAxis;
DeviceMotionAndOrientationManager m_deviceMotionAndOrientationManager;
#if ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebKit/android/nav/SelectText.h b/Source/WebKit/android/nav/SelectText.h
index 904b2b9..50bc82e 100644
--- a/Source/WebKit/android/nav/SelectText.h
+++ b/Source/WebKit/android/nav/SelectText.h
@@ -43,6 +43,8 @@ public:
IntRect& caretRect(HandleId id) { return m_caretRects[mapId(id)]; }
void setCaretRect(HandleId id, const IntRect& rect) { m_caretRects[mapId(id)] = rect; }
+ IntRect& textRect(HandleId id) { return m_textRects[mapId(id)]; }
+ void setTextRect(HandleId id, const IntRect& rect) { m_textRects[mapId(id)] = rect; }
int caretLayerId(HandleId id) { return m_caretLayerId[mapId(id)]; }
void setCaretLayerId(HandleId id, int layerId) { m_caretLayerId[mapId(id)] = layerId; }
@@ -56,6 +58,7 @@ private:
HandleId mapId(HandleId id);
IntRect m_caretRects[2];
+ IntRect m_textRects[2];
int m_caretLayerId[2];
bool m_baseIsFirst;
String m_text;
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index ddb9bcb..37291de 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -125,6 +125,10 @@ struct JavaGlue {
jfieldID m_rectTop;
jmethodID m_rectWidth;
jmethodID m_rectHeight;
+ jfieldID m_quadFP1;
+ jfieldID m_quadFP2;
+ jfieldID m_quadFP3;
+ jfieldID m_quadFP4;
AutoJObject object(JNIEnv* env) {
return getRealObject(env, m_obj);
}
@@ -156,6 +160,14 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl, WTF::String drawableDir,
m_javaGlue.m_rectHeight = GetJMethod(env, rectClass, "height", "()I");
env->DeleteLocalRef(rectClass);
+ jclass quadFClass = env->FindClass("android/webkit/QuadF");
+ ALOG_ASSERT(quadFClass, "Could not find QuadF class");
+ m_javaGlue.m_quadFP1 = env->GetFieldID(quadFClass, "p1", "Landroid/graphics/PointF;");
+ m_javaGlue.m_quadFP2 = env->GetFieldID(quadFClass, "p2", "Landroid/graphics/PointF;");
+ m_javaGlue.m_quadFP3 = env->GetFieldID(quadFClass, "p3", "Landroid/graphics/PointF;");
+ m_javaGlue.m_quadFP4 = env->GetFieldID(quadFClass, "p4", "Landroid/graphics/PointF;");
+ env->DeleteLocalRef(quadFClass);
+
env->SetIntField(javaWebView, gWebViewField, (jint)this);
m_viewImpl = (WebViewCore*) viewImpl;
m_generation = 0;
@@ -578,12 +590,20 @@ void setTextSelection(SelectText *selection) {
setDrawExtra(selection, DrawExtrasSelection);
}
-int getHandleLayerId(SelectText::HandleId handleId, SkIRect& cursorRect) {
+int getHandleLayerId(SelectText::HandleId handleId, SkIPoint& cursorPoint,
+ FloatQuad& textBounds) {
SelectText* selectText = static_cast<SelectText*>(getDrawExtra(DrawExtrasSelection));
if (!selectText || !m_baseLayer)
return -1;
int layerId = selectText->caretLayerId(handleId);
- cursorRect = selectText->caretRect(handleId);
+ IntRect cursorRect = selectText->caretRect(handleId);
+ IntRect textRect = selectText->textRect(handleId);
+ // Rects exclude the last pixel on right/bottom. We want only included pixels.
+ cursorPoint.set(cursorRect.x(), cursorRect.maxY() - 1);
+ textRect.setHeight(textRect.height() - 1);
+ textRect.setWidth(textRect.width() - 1);
+ textBounds = FloatQuad(textRect);
+
if (layerId != -1) {
// We need to make sure the drawTransform is up to date as this is
// called before a draw() or drawGL()
@@ -594,13 +614,8 @@ int getHandleLayerId(SelectText::HandleId handleId, SkIRect& cursorRect) {
const TransformationMatrix* transform = layer->drawTransform();
// We're overloading the concept of Rect to be just the two
// points (bottom-left and top-right.
- // TODO: Use FloatQuad instead.
- IntPoint bottomLeft = transform->mapPoint(IntPoint(cursorRect.fLeft,
- cursorRect.fBottom));
- IntPoint topRight = transform->mapPoint(IntPoint(cursorRect.fRight,
- cursorRect.fTop));
- cursorRect.setLTRB(bottomLeft.x(), topRight.y(), topRight.x(),
- bottomLeft.y());
+ cursorPoint = transform->mapPoint(cursorPoint);
+ textBounds = transform->mapQuad(textBounds);
}
}
return layerId;
@@ -617,6 +632,23 @@ void mapLayerRect(int layerId, SkIRect& rect) {
}
}
+void floatQuadToQuadF(JNIEnv* env, const FloatQuad& nativeTextQuad,
+ jobject textQuad)
+{
+ jobject p1 = env->GetObjectField(textQuad, m_javaGlue.m_quadFP1);
+ jobject p2 = env->GetObjectField(textQuad, m_javaGlue.m_quadFP2);
+ jobject p3 = env->GetObjectField(textQuad, m_javaGlue.m_quadFP3);
+ jobject p4 = env->GetObjectField(textQuad, m_javaGlue.m_quadFP4);
+ GraphicsJNI::point_to_jpointf(nativeTextQuad.p1(), env, p1);
+ GraphicsJNI::point_to_jpointf(nativeTextQuad.p2(), env, p2);
+ GraphicsJNI::point_to_jpointf(nativeTextQuad.p3(), env, p3);
+ GraphicsJNI::point_to_jpointf(nativeTextQuad.p4(), env, p4);
+ env->DeleteLocalRef(p1);
+ env->DeleteLocalRef(p2);
+ env->DeleteLocalRef(p3);
+ env->DeleteLocalRef(p4);
+}
+
// This is called when WebView switches rendering modes in a more permanent fashion
// such as when the layer type is set or the view is attached/detached from the window
int setHwAccelerated(bool hwAccelerated) {
@@ -1140,13 +1172,18 @@ static void nativeSetTextSelection(JNIEnv *env, jobject obj, jint nativeView,
}
static jint nativeGetHandleLayerId(JNIEnv *env, jobject obj, jint nativeView,
- jint handleIndex, jobject cursorRect)
+ jint handleIndex, jobject cursorPoint,
+ jobject textQuad)
{
WebView* webview = reinterpret_cast<WebView*>(nativeView);
- SkIRect nativeRect;
- int layerId = webview->getHandleLayerId((SelectText::HandleId) handleIndex, nativeRect);
- if (cursorRect)
- GraphicsJNI::irect_to_jrect(nativeRect, env, cursorRect);
+ SkIPoint nativePoint;
+ FloatQuad nativeTextQuad;
+ int layerId = webview->getHandleLayerId((SelectText::HandleId) handleIndex,
+ nativePoint, nativeTextQuad);
+ if (cursorPoint)
+ GraphicsJNI::ipoint_to_jpoint(nativePoint, env, cursorPoint);
+ if (textQuad)
+ webview->floatQuadToQuadF(env, nativeTextQuad, textQuad);
return layerId;
}
@@ -1247,7 +1284,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeSetPauseDrawing },
{ "nativeSetTextSelection", "(II)V",
(void*) nativeSetTextSelection },
- { "nativeGetHandleLayerId", "(IILandroid/graphics/Rect;)I",
+ { "nativeGetHandleLayerId", "(IILandroid/graphics/Point;Landroid/webkit/QuadF;)I",
(void*) nativeGetHandleLayerId },
{ "nativeIsBaseFirst", "(I)Z",
(void*) nativeIsBaseFirst },