summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2011-03-23 10:02:01 -0400
committerCary Clark <cary@android.com>2011-03-23 10:12:25 -0400
commitef25442f9f65d5f8283b2a5c2b90e63bf875c694 (patch)
tree12a9caf33d400b7432c1df24f2c16c20932b5fbc
parent772742124c1e5c700120019397dc8af29ced74c0 (diff)
downloadexternal_webkit-ef25442f9f65d5f8283b2a5c2b90e63bf875c694.zip
external_webkit-ef25442f9f65d5f8283b2a5c2b90e63bf875c694.tar.gz
external_webkit-ef25442f9f65d5f8283b2a5c2b90e63bf875c694.tar.bz2
don't call bounder when uninitialized
If the canvas' device list has never been set up, or has been set to an empty clip, the bounder's clip will not be initialized, and checking bounding rect may fail. Check to see if the bounder was ever called for an individual glyph before checking the result. bug:4155270 Change-Id: I625e885d13208e82c44259277c74b8f0cef5b0cb
-rw-r--r--WebKit/android/nav/CachedRoot.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp
index f5f8a71..64bf19a 100644
--- a/WebKit/android/nav/CachedRoot.cpp
+++ b/WebKit/android/nav/CachedRoot.cpp
@@ -89,6 +89,8 @@ public:
return doIRect(mUnion);
}
+ bool isEmpty() { return mUnion.isEmpty(); }
+
bool joinGlyphs(const SkIRect& rect) {
bool isGlyph = mType == kDrawGlyph_Type;
if (isGlyph)
@@ -188,7 +190,8 @@ public:
mBounder.setEmpty();
mBounder.setType(CommonCheck::kDrawGlyph_Type);
INHERITED::drawPosText(text, byteLength, pos, paint);
- mBounder.doRect(CommonCheck::kDrawPosText_Type);
+ if (!mBounder.isEmpty())
+ mBounder.doRect(CommonCheck::kDrawPosText_Type);
}
virtual void drawPosTextH(const void* text, size_t byteLength,