-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] ToColor should produce a DlColor, not SkColor. #43987
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
9933aa0 to
8b6c440
Compare
jonahwilliams
left a comment
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.
LGTM (though you'll need to get the CLA issue fixed before this can merge)
|
Thanks! I had to |
|
@flar Since you wrote the original issue I'd love to get your review as well. Thanks! |
|
You'll need to update flutter licenses, the instructions on how to do so are in the output of the Linux linux_license shard: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8774624389745971521/+/u/test:_licenses_check/stdout For the Fuchsia failures, those compilation errors seem bogus. I would see if they go away when you push another commit, or use the rebase button in the github UI. |
|
This is one half of it. The other part of that Issue was that the Impeller code was handing Skia color constants to APIs that were expecting DlColor objects - unit tests mainly. As the issue says, DlColor and SkColor are auto-converted between each other so the compiler and linter don't call that practice out. Perhaps grep the sources: DlColor has the |
Didn't actually fix the problem. This reverts commit 644a91f.
|
Thanks @flar. Just to be clear, do you expect all of these updated: $ rg -i 'sk(_)?color'
typographer/backends/skia/text_render_context_skia.cc
171: auto glyph_color = has_color ? SK_ColorWHITE : SK_ColorBLACK;
image/backends/skia/compressed_image_skia.cc
57: kRGBA_8888_SkColorType, kPremul_SkAlphaType);
display_list/skia_conversions.h
14:#include "third_party/skia/include/core/SkColor.h"
15:#include "third_party/skia/include/core/SkColorType.h"
47:std::optional<impeller::PixelFormat> ToPixelFormat(SkColorType type);
display_list/dl_unittests.cc
33:#include "third_party/skia/include/core/SkColor.h"
124: paint.setColor(SK_ColorRED);
212: paint.setColor(SK_ColorGREEN);
215: paint.setColor(SK_ColorRED);
229: paint.setColor(SK_ColorRED);
401: paint.setColor(SK_ColorRED);
430: paint.setColor(SK_ColorYELLOW);
483: auto filter = flutter::DlBlendColorFilter(SK_ColorYELLOW,
493: flutter::DlBlendColorFilter(SK_ColorRED, flutter::DlBlendMode::kScreen);
863: SK_ColorTRANSPARENT, 15, false, 1);
display_list/skia_conversions.cc
172:std::optional<impeller::PixelFormat> ToPixelFormat(SkColorType type) {
174: case kRGBA_8888_SkColorType:
176: case kBGRA_8888_SkColorType:
178: case kRGBA_F16_SkColorType:
180: case kBGR_101010x_XR_SkColorType: |
2c96e5b to
ac5b125
Compare
|
Looks like, minus tree status, this is ready to merge 🥳 . @flar at your convenience, want to double-check I made the changes you expected? Thanks! |
flar
left a comment
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.
LGTM
I didn't do an exhaustive search. If there are others then they will likely be eliminated as we start omitting more and more Skia includes from code that isn't directly responsible for adapting the 2 modules. For example, you were able to get rid of the include of |
Not the "color type" ones, but the others, yes. |
The standard practice is to add the |
…131307) flutter/engine@9e00c11...db711f1 2023-07-26 [email protected] [Impeller] ToColor should produce a DlColor, not SkColor. (flutter/engine#43987) 2023-07-26 [email protected] Roll ANGLE from b0b71d59391c to 84f5295c9782 (3 revisions) (flutter/engine#44025) 2023-07-25 [email protected] Uncap framerate for `iOSAppOnMac` (flutter/engine#43840) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131307) flutter/engine@9e00c11...db711f1 2023-07-26 [email protected] [Impeller] ToColor should produce a DlColor, not SkColor. (flutter/engine#43987) 2023-07-26 [email protected] Roll ANGLE from b0b71d59391c to 84f5295c9782 (3 revisions) (flutter/engine#44025) 2023-07-25 [email protected] Uncap framerate for `iOSAppOnMac` (flutter/engine#43840) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131307) flutter/engine@9e00c11...db711f1 2023-07-26 [email protected] [Impeller] ToColor should produce a DlColor, not SkColor. (flutter/engine#43987) 2023-07-26 [email protected] Roll ANGLE from b0b71d59391c to 84f5295c9782 (3 revisions) (flutter/engine#44025) 2023-07-25 [email protected] Uncap framerate for `iOSAppOnMac` (flutter/engine#43840) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Closes flutter/flutter#124455.