aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyph.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-02-02 21:06:23 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-02 21:06:23 -0800
commit9bf4e5bbf6ca96042c0e0f5dca9a52a943f25716 (patch)
tree2e613651f001686475f9302690f39510fa10bdeb /src/core/SkGlyph.h
parentb9eb4ac0f1c29d6fe10ad7ff81ed8326ac1ea043 (diff)
Revert of Make the glyph array entries inline. (patchset #10 id:170001 of https://codereview.chromium.org/885903002/)
Reason for revert: I suspect this is causing the off-by-one character issues that show up in gold.skia.org as of now. All the errors I've seen are on a Win7 bot. Example: good: https://gold.skia.org/img/images/35396bb0d299b81c0031dc0632a019d4.png bad: https://gold.skia.org/img/images/484e511f9e696d95031cd25aeae59da0.png Original issue's description: > Make the glyph array entries inline. > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1 TBR=mtklein@google.com,reed@google.com,herb@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/897463004
Diffstat (limited to 'src/core/SkGlyph.h')
-rw-r--r--src/core/SkGlyph.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h
index 4f9c5bf4cc..9abefa84c7 100644
--- a/src/core/SkGlyph.h
+++ b/src/core/SkGlyph.h
@@ -104,10 +104,8 @@ struct SkGlyph {
kSubShiftY = 0
};
- // The code is increased by one in MakeID. Adjust back. This allows the zero
- // id to be the invalid id.
static unsigned ID2Code(uint32_t id) {
- return (id & kCodeMask) - 1;
+ return id & kCodeMask;
}
static unsigned ID2SubX(uint32_t id) {
@@ -127,21 +125,17 @@ struct SkGlyph {
return sub << (16 - kSubBits);
}
- // This and the MakeID below must not return an id of zero. Zero is used as
- // the invalid id.
static uint32_t MakeID(unsigned code) {
- SkASSERT(code + 1 <= kCodeMask);
- return code + 1;
+ return code;
}
- // See comment for MakeID above.
static uint32_t MakeID(unsigned code, SkFixed x, SkFixed y) {
- SkASSERT(code + 1 <= kCodeMask);
+ SkASSERT(code <= kCodeMask);
x = FixedToSub(x);
y = FixedToSub(y);
return (x << (kSubShift + kSubShiftX)) |
(y << (kSubShift + kSubShiftY)) |
- (code + 1);
+ code;
}
void toMask(SkMask* mask) const;