Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Forcing GPU mode for better CSS Filter rendering on Retina. #9506

Merged
merged 3 commits into from
Oct 20, 2014

Conversation

larz0
Copy link
Member

@larz0 larz0 commented Oct 9, 2014

This is a fix for #9377.

Scrolling is better now for some reason. (Possible fix for #9486?)

@@ -740,6 +740,7 @@ a, img {
padding: 4px 6px;
.sprite-icon(0, 0, 13px, 13px, "images/split-view-icons.svg");
background-origin: content-box; // center image within the 13x13 area - ignore button's padding
-webkit-transform: translateZ(0); // forces GPU mode for better filter rending on retina
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: rending

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are going to want to add an unprefixed version (transform: translateZ(0)) after this for multi-browser support, including Chrome 36.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok both done. Thanks guys.

@redmunds
Copy link
Contributor

redmunds commented Oct 9, 2014

@larz0 Scrolling speed seems good to me both with and without this change. The only difference I notice is that on Mac Retina I can throw scroll farther in a single throw with this change than I can in master.

@larz0
Copy link
Member Author

larz0 commented Oct 9, 2014

@redmunds cool. I've updated this PR based on @RaymondLim and @le717's feedback.

@larz0
Copy link
Member Author

larz0 commented Oct 20, 2014

@redmunds can we merge this? I'm taking screenshots on retina mbp and the icon is blurry.

@redmunds
Copy link
Contributor

@LarZ Sorry, I forgot about this one. For future reference, put the milestone on the issue, not the pull request. Merging

redmunds added a commit that referenced this pull request Oct 20, 2014
Forcing GPU mode for better CSS Filter rendering on Retina.
@redmunds redmunds merged commit 97b5031 into master Oct 20, 2014
@redmunds redmunds deleted the larz/issue-9377 branch October 20, 2014 22:30
@redmunds redmunds removed this from the Brackets 1.0 (Release 0.45) milestone Oct 20, 2014
@larz0
Copy link
Member Author

larz0 commented Oct 20, 2014

@redmunds ahh. I'll do that in the future 👍

@@ -740,6 +740,8 @@ a, img {
padding: 4px 6px;
.sprite-icon(0, 0, 13px, 13px, "images/split-view-icons.svg");
background-origin: content-box; // center image within the 13x13 area - ignore button's padding
-webkit-transform: translateZ(0); // forces GPU mode for better filter rendering on retina
transform: translateZ(0); // future proofing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larz0 I'm curious why this particular SVG file (and we have many) renders more crisp with GPU enabled? Is there something about this image that's different?

Doing this effectively turns on hardware compositing for the entire page (making all compositing on the GPU and, thus, seemingly faster) so wouldn't it be logical and more readable to add the Null Transform Hack on the body style?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because I used css filter on this icon and not on the others. This icon uses real drop shadow (filter) whereas the others use a fake shadow (duplicate icon path).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently we shouldn't force gpu everywhere. I'll let you know when I find that article.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants