diff options
author | mtklein <mtklein@chromium.org> | 2014-12-01 06:59:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-01 06:59:55 -0800 |
commit | 5c9c9be1f540e1895e65fbd244caae9135972143 (patch) | |
tree | 7ce2b61adb7cc0f46c992ea968400e82c63e67bf /src/core/SkPathRef.cpp | |
parent | 88fd0fbcccea615f2d2cd61a121ac9e3185adfe4 (diff) |
Force path bounds in recording.
The use of SKTRacy isn't safe in SkPathRef.
There are logical dependencies between the racy fields.
Doesn't seem to affect recording performance:
$ c --match skp --config nonrendering
tabl_techmeme.skp 81.1us -> 86us 1.06x
desk_mapsvg.skp 1.23ms -> 1.26ms 1.02x
desk_yahooanswers.skp 114us -> 117us 1.02x
tabl_sahadan.skp 70.9us -> 72us 1.02x
desk_fontwipe.skp 31.6us -> 32us 1.01x
tabl_cuteoverload.skp 414us -> 419us 1.01x
desk_mobilenews.skp 503us -> 508us 1.01x
desk_tigersvg.skp 150us -> 152us 1.01x
desk_samoasvg.skp 608us -> 610us 1x
tabl_digg.skp 636us -> 638us 1x
tabl_pravda.skp 155us -> 156us 1x
desk_jsfiddlehumperclip.skp 33.9us -> 33.9us 1x
tabl_culturalsolutions.skp 295us -> 295us 1x
desk_youtube.skp 447us -> 448us 1x
desk_gws.skp 144us -> 144us 1x
tabl_frantzen.skp 42us -> 42us 1x
tabl_gspro.skp 50.1us -> 50us 1x
tabl_googlecalendar.skp 165us -> 165us 1x
desk_twitter.skp 359us -> 358us 1x
desk_wordpress.skp 588us -> 583us 0.99x
desk_jsfiddlebigcar.skp 32.8us -> 32.5us 0.99x
desk_booking.skp 838us -> 827us 0.99x
tabl_androidpolice.skp 1.42ms -> 1.4ms 0.99x
desk_blogger.skp 378us -> 372us 0.98x
desk_wowwiki.skp 1.11ms -> 1.09ms 0.98x
tabl_cnet.skp 115us -> 112us 0.97x
desk_silkfinance.skp 57.7us -> 55.9us 0.97x
tabl_cnn.skp 136us -> 131us 0.97x
desk_sfgate.skp 396us -> 377us 0.95x
tabl_deviantart.skp 107us -> 102us 0.95x
tabl_mozilla.skp 1.4ms -> 1.32ms 0.94x
BUG=437511
Review URL: https://codereview.chromium.org/762313002
Diffstat (limited to 'src/core/SkPathRef.cpp')
-rw-r--r-- | src/core/SkPathRef.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp index ad85fd06a8..aed6cdaee7 100644 --- a/src/core/SkPathRef.cpp +++ b/src/core/SkPathRef.cpp @@ -87,13 +87,13 @@ void SkPathRef::CreateTransformedCopy(SkAutoTUnref<SkPathRef>* dst, if (canXformBounds) { (*dst)->fBoundsIsDirty = false; if (src.fIsFinite) { - matrix.mapRect((*dst)->fBounds.get(), src.fBounds); - if (!((*dst)->fIsFinite = (*dst)->fBounds->isFinite())) { - (*dst)->fBounds->setEmpty(); + matrix.mapRect(&(*dst)->fBounds, src.fBounds); + if (!((*dst)->fIsFinite = (*dst)->fBounds.isFinite())) { + (*dst)->fBounds.setEmpty(); } } else { (*dst)->fIsFinite = false; - (*dst)->fBounds->setEmpty(); + (*dst)->fBounds.setEmpty(); } } else { (*dst)->fBoundsIsDirty = true; @@ -449,14 +449,14 @@ void SkPathRef::validate() const { SkASSERT(this->currSize() == fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVerbCnt); - if (!fBoundsIsDirty && !fBounds->isEmpty()) { + if (!fBoundsIsDirty && !fBounds.isEmpty()) { bool isFinite = true; for (int i = 0; i < fPointCnt; ++i) { SkASSERT(!fPoints[i].isFinite() || ( - fBounds->fLeft - fPoints[i].fX < SK_ScalarNearlyZero && - fPoints[i].fX - fBounds->fRight < SK_ScalarNearlyZero && - fBounds->fTop - fPoints[i].fY < SK_ScalarNearlyZero && - fPoints[i].fY - fBounds->fBottom < SK_ScalarNearlyZero)); + fBounds.fLeft - fPoints[i].fX < SK_ScalarNearlyZero && + fPoints[i].fX - fBounds.fRight < SK_ScalarNearlyZero && + fBounds.fTop - fPoints[i].fY < SK_ScalarNearlyZero && + fPoints[i].fY - fBounds.fBottom < SK_ScalarNearlyZero)); if (!fPoints[i].isFinite()) { isFinite = false; } |