-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic subpixel AA text support on Linux. #527
Conversation
Re: gamma correction. I've elaborated some of my thoughts in #230. |
293294b
to
dd2f5fb
Compare
r? @pcwalton |
BlendMode::Alpha | ||
} else { | ||
BlendMode::None | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could be
_ if needs_blending => BlendMode::Alpha,
_ => BlendMode::None
Up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left as is for now - will tidy up when I expand this function today for a different PR.
@@ -215,6 +217,9 @@ impl FontContext { | |||
} | |||
} | |||
FT_PIXEL_MODE_LCD => { | |||
// Extra subpixel on each side of the glyph. | |||
glyph_width += 2; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly. :( Oh well, probably can't be helped.
@@ -92,6 +92,7 @@ const GPU_TAG_PRIM_BORDER: GpuProfileTag = GpuProfileTag { label: "Border", colo | |||
pub enum BlendMode { | |||
None, | |||
Alpha, | |||
Subpixel(ColorF), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment saying that the ColorF
is the color of the text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
This is some preliminary support for subpixel AA. Specifically: * Only on Linux for now. * No gamma correction. * Disabled by default (use -Z subpixel-aa to test). * Doesn't deal with rotations, subpixel positioning etc.
@bors-servo r=pcwalton (irc) |
📌 Commit bab4731 has been approved by |
Add basic subpixel AA text support on Linux. This is some preliminary support for subpixel AA. Specifically: * Only on Linux for now. * No gamma correction. * Disabled by default (use -Z subpixel-aa to test). * Doesn't deal with rotations, subpixel positioning etc. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/527) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
This is some preliminary support for subpixel AA. Specifically:
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)