Skip to content

Commit 669e1f8

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "Remove nativeRecordButtons" into ics-mr1
2 parents b1dbf8e + 99f7b7b commit 669e1f8

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

core/java/android/webkit/WebView.java

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4119,20 +4119,6 @@ protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
41194119
}
41204120

41214121
private void drawContent(Canvas canvas, boolean drawRings) {
4122-
// Update the buttons in the picture, so when we draw the picture
4123-
// to the screen, they are in the correct state.
4124-
// Tell the native side if user is a) touching the screen,
4125-
// b) pressing the trackball down, or c) pressing the enter key
4126-
// If the cursor is on a button, we need to draw it in the pressed
4127-
// state.
4128-
// If mNativeClass is 0, we should not reach here, so we do not
4129-
// need to check it again.
4130-
boolean pressed = (mTouchMode == TOUCH_SHORTPRESS_START_MODE
4131-
|| mTouchMode == TOUCH_INIT_MODE
4132-
|| mTouchMode == TOUCH_SHORTPRESS_MODE);
4133-
recordButtons(canvas,
4134-
hasFocus() && hasWindowFocus(), (pressed && !USE_WEBKIT_RINGS)
4135-
|| mTrackballDown || mGotCenterDown, false);
41364122
drawCoreAndCursorRing(canvas, mBackgroundColor,
41374123
mDrawCursorRing && drawRings);
41384124
}
@@ -5193,9 +5179,6 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
51935179
mGotCenterDown = true;
51945180
mPrivateHandler.sendMessageDelayed(mPrivateHandler
51955181
.obtainMessage(LONG_PRESS_CENTER), LONG_PRESS_TIMEOUT);
5196-
// Already checked mNativeClass, so we do not need to check it
5197-
// again.
5198-
recordButtons(null, hasFocus() && hasWindowFocus(), true, true);
51995182
if (!wantsKeyEvents) return true;
52005183
}
52015184
// Bubble up the key event as WebView doesn't handle it
@@ -5631,9 +5614,6 @@ void setActive(boolean active) {
56315614
// drawing the cursor ring
56325615
mDrawCursorRing = true;
56335616
setFocusControllerActive(true);
5634-
if (mNativeClass != 0) {
5635-
recordButtons(null, true, false, true);
5636-
}
56375617
} else {
56385618
if (!inEditingMode()) {
56395619
// If our window gained focus, but we do not have it, do not
@@ -5659,9 +5639,6 @@ void setActive(boolean active) {
56595639
mKeysPressed.clear();
56605640
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
56615641
mTouchMode = TOUCH_DONE_MODE;
5662-
if (mNativeClass != 0) {
5663-
recordButtons(null, false, false, true);
5664-
}
56655642
setFocusControllerActive(false);
56665643
}
56675644
invalidate();
@@ -5717,9 +5694,6 @@ protected void onFocusChanged(boolean focused, int direction,
57175694
// the cursor ring
57185695
if (hasWindowFocus()) {
57195696
mDrawCursorRing = true;
5720-
if (mNativeClass != 0) {
5721-
recordButtons(null, true, false, true);
5722-
}
57235697
setFocusControllerActive(true);
57245698
//} else {
57255699
// The WebView has gained focus while we do not have
@@ -5731,9 +5705,6 @@ protected void onFocusChanged(boolean focused, int direction,
57315705
// true if we are in editing mode), stop drawing the cursor ring.
57325706
if (!inEditingMode()) {
57335707
mDrawCursorRing = false;
5734-
if (mNativeClass != 0) {
5735-
recordButtons(null, false, false, true);
5736-
}
57375708
setFocusControllerActive(false);
57385709
}
57395710
mKeysPressed.clear();
@@ -6847,7 +6818,6 @@ public boolean onTrackballEvent(MotionEvent ev) {
68476818
if (mNativeClass == 0) {
68486819
return false;
68496820
}
6850-
recordButtons(null, hasFocus() && hasWindowFocus(), true, true);
68516821
if (time - mLastCursorTime <= TRACKBALL_TIMEOUT
68526822
&& !mLastCursorBounds.equals(nativeGetCursorRingBounds())) {
68536823
nativeSelectBestAt(mLastCursorBounds);
@@ -9442,24 +9412,6 @@ public float tileProfilingGetFloat(int frame, int tile, String key) {
94429412
return nativeTileProfilingGetFloat(frame, tile, key);
94439413
}
94449414

9445-
/**
9446-
* Helper method to deal with differences between hardware and software rendering
9447-
*/
9448-
private void recordButtons(Canvas canvas, boolean focus, boolean pressed,
9449-
boolean inval) {
9450-
boolean isHardwareAccel = canvas != null
9451-
? canvas.isHardwareAccelerated()
9452-
: isHardwareAccelerated();
9453-
if (isHardwareAccel) {
9454-
// We never want to change button state if we are hardware accelerated,
9455-
// but we DO want to invalidate as necessary so that the GL ring
9456-
// can be drawn
9457-
nativeRecordButtons(mNativeClass, false, false, inval);
9458-
} else {
9459-
nativeRecordButtons(mNativeClass, focus, pressed, inval);
9460-
}
9461-
}
9462-
94639415
private native int nativeCacheHitFramePointer();
94649416
private native boolean nativeCacheHitIsPlugin();
94659417
private native Rect nativeCacheHitNodeBounds();
@@ -9556,8 +9508,6 @@ private native boolean nativeMoveCursor(int keyCode, int count,
95569508
private native boolean nativePointInNavCache(int x, int y, int slop);
95579509
// Like many other of our native methods, you must make sure that
95589510
// mNativeClass is not null before calling this method.
9559-
private native void nativeRecordButtons(int nativeInstance,
9560-
boolean focused, boolean pressed, boolean invalidate);
95619511
private native void nativeResetSelection();
95629512
private native Point nativeSelectableText();
95639513
private native void nativeSelectAll();

0 commit comments

Comments
 (0)