Fixing invalid text clipping on SkPicture playback
authorjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 22 Jan 2013 17:50:47 +0000 (17:50 +0000)
committerjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 22 Jan 2013 17:50:47 +0000 (17:50 +0000)
commitf3b1223e6d52b161dbc59a4119ba6a4161b10a54
tree259268d9e718739de4aa3daa0ff12b10ef7b9524
parentb83b6b4f7690fe929d8d6b1a3d2b7ed562b95ba6
Fixing invalid text clipping on SkPicture playback

The bug was caused by an invalid assumption that a flattend object's
index is related to its array index in SkFlatDictionary::fData.
The data in SkFlatDictionary is sorted by flattened data content,
not by index number. Problem was solved by passing down the SkFlatData*
through addPaint, rather than the index value. The bug was causing
SkPictureRecord::addFontMetricsTopBottom to use cached font metrics
from the wrong SkPaint instance.

BUG=https://code.google.com/p/chromium/issues/detail?id=170964
Review URL: https://codereview.appspot.com/7178045

git-svn-id: http://skia.googlecode.com/svn/trunk@7312 2bbb7eff-a529-9590-31e7-b0007b416f81
src/core/SkPictureFlat.h
src/core/SkPictureRecord.cpp
src/core/SkPictureRecord.h