OSDN Git Service

don't join non-adjacent bitmaps
authorCary Clark <cary@android.com>
Thu, 6 Jan 2011 18:05:07 +0000 (13:05 -0500)
committerCary Clark <cary@android.com>
Thu, 6 Jan 2011 18:05:07 +0000 (13:05 -0500)
When computing cursor rings, adjacent bitmaps and rectangles
may be joined into one. Glyphs may be non-adjacent to account
for intercharacter spacing and white space characters.

Bitmaps and rects may be close by but not joinable if they
don't share a common edge.

bug:3322613
Change-Id: Ie9e4b4f9f66857c533a8459c0f8a9a62d0be8dcd

WebKit/android/nav/CachedRoot.cpp

index d529a00..3823ec9 100644 (file)
@@ -899,10 +899,10 @@ protected:
             return false;
         if (mLayerTypes.isEmpty() || mLayerTypes.last() != mType
             || !mAppendLikeTypes
-            // if the last was a rect, and the current one is also a rect,
-            // but the two rects have a gap between, don't join them -- push
+            // if the last and current were not glyphs,
+            // and the two bounds have a gap between, don't join them -- push
             // an empty between them
-            || (mType == kDrawRect_Type && !joinable(rect))) {
+            || (mType != kDrawGlyph_Type && !joinable(rect))) {
             push(mType, mEmpty);
         }
         DBG_NAV_LOGD("RingCheck join %s (%d,%d,r=%d,b=%d) '%c'",