Skip to content

Commit 57efcff

Browse files
committed
Fix text selection drawing on SW
Bug: 5312770 Helps if you actually draw stuff... Change-Id: I5ab8cd0726cac77a91fb476c7db0873132ba91d9
1 parent b5dfcb8 commit 57efcff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/java/android/webkit/WebView.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4436,6 +4436,7 @@ private void drawCoreAndCursorRing(Canvas canvas, int color,
44364436
mHeldMotionless = MOTIONLESS_PENDING;
44374437
}
44384438
}
4439+
int saveCount = canvas.save();
44394440
if (animateZoom) {
44404441
mZoomManager.animateZoom(canvas);
44414442
} else if (!canvas.isHardwareAccelerated()) {
@@ -4486,10 +4487,6 @@ private void drawCoreAndCursorRing(Canvas canvas, int color,
44864487
nativeUseHardwareAccelSkia(mHardwareAccelSkia);
44874488
}
44884489

4489-
if (mSelectingText && USE_JAVA_TEXT_SELECTION) {
4490-
drawTextSelectionHandles(canvas);
4491-
}
4492-
44934490
} else {
44944491
DrawFilter df = null;
44954492
if (mZoomManager.isZoomAnimating() || UIAnimationsRunning) {
@@ -4507,6 +4504,11 @@ private void drawCoreAndCursorRing(Canvas canvas, int color,
45074504
}
45084505
}
45094506

4507+
canvas.restoreToCount(saveCount);
4508+
if (mSelectingText && USE_JAVA_TEXT_SELECTION) {
4509+
drawTextSelectionHandles(canvas);
4510+
}
4511+
45104512
if (extras == DRAW_EXTRAS_CURSOR_RING) {
45114513
if (mTouchMode == TOUCH_SHORTPRESS_START_MODE) {
45124514
mTouchMode = TOUCH_SHORTPRESS_MODE;

0 commit comments

Comments
 (0)