aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RecordDrawTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2014-12-16 06:31:01 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-16 06:31:01 -0800
commit9a5380dd358a9c559a41beef7cb368cd7f0ca51f (patch)
tree85fce3373cc0d0982c1a4b7f200149e8b018b843 /tests/RecordDrawTest.cpp
parentbdd22a35bfb3bb087ea37a328f14db2c7796f9df (diff)
Revert of Use SkPaint::getFontBounds() for text bounding boxes in pictures. (patchset #1 id:1 of https://codereview.chromium.org/805983003/)
Reason for revert: Test-Win7-ShuttleA-HD2000-x86-Debug-GDI Original issue's description: > Use SkPaint::getFontBounds() for text bounding boxes in pictures. > > Now that SkTextBlobs have landed, this is a perf no-op, but it at least lets us eliminate a bunch of questionable hacks. > > CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot,Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug-Trybot > > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/02d2b9831579173e783569530ab7bae08de907e9 TBR=reed@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/789793004
Diffstat (limited to 'tests/RecordDrawTest.cpp')
-rw-r--r--tests/RecordDrawTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp
index fb5e9cf3dd..e830af4b43 100644
--- a/tests/RecordDrawTest.cpp
+++ b/tests/RecordDrawTest.cpp
@@ -191,11 +191,11 @@ DEF_TEST(RecordDraw_TextBounds, r) {
SkRecordFillBounds(SkRect::MakeWH(SkIntToScalar(W), SkIntToScalar(H)), record, &bbh);
REPORTER_ASSERT(r, bbh.fEntries.count() == 2);
- // Font metrics are somewhat platform dependent, so these assertions may need to be adjusted.
- // But these particular numbers are left over from the days when we used to wildly overestimate
- // font metrics, so these assertions should actually be pretty safe.
- REPORTER_ASSERT(r, SkRect::MakeLTRB(0, 0,140, 60).contains(bbh.fEntries[0].bounds));
- REPORTER_ASSERT(r, SkRect::MakeLTRB(0,20,180,100).contains(bbh.fEntries[1].bounds));
+ // We can make these next assertions confidently because SkRecordFillBounds
+ // builds its bounds by overestimating font metrics in a platform-independent way.
+ // If that changes, these tests will need to be more flexible.
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(0, 0, 140, 60)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(0, 20, 180, 100)));
}
// Base test to ensure start/stop range is respected