-
Notifications
You must be signed in to change notification settings - Fork 6k
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. |
3b53044
to
eb221b8
Compare
@flar Hey, this is about the |
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.
Some of the information in this review is now covered under a new comment on the "graphics package neutral" issue.
In the end, implementing this particular may end up being eliminated by upcoming Impeller work. It may be useful in the short term (for weeks if not months) for "Flutter on DisplayList on Skia", but that is something to consider with respect to how much time to spend on this object.
Minimally, it implements way more flavors of PathEffect than we will ever see and so it should be cut down to only those sub-classes that we need (Dash + Unknown?)
If you want to finish this work off, then consider the comments below about trimming it down and I will review again in a more focused implementation.
@flar As you say, I have cut down other |
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 only done a light read through as I'd like to see the DlDashPathEffect use inline storage for the intervals to be bulk-compare compatible for the DisplayList buffer.
@flar hi, I have fixed the comments please help me take a look. Thanks |
e494718
to
1639133
Compare
@flar hey, I have fix the comments, please give me a review, thanks. And the |
1639133
to
9aaea6a
Compare
ee2e487
to
adad369
Compare
|
||
TEST(DisplayListPathEffect, BlurNotEquals) { | ||
const SkScalar TestDashes1[] = {4.0, 2.0}; | ||
const SkScalar TestDashes2[] = {1.0, 1.5}; |
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.
You misread or misunderstood my comment.
Use the TestNotEquals helper methods in display_list_attributes_testing.h
Test 4 potential sources of inequality as below:
This is what I was asking for:
const SkScalar TestDashes1[] = {4.0, 2.0};
const SkScalar TestDashes2[] = {5.0, 2.0};
const SkScalar TestDashes3[] = {4.0, 3.0};
const SkScalar TestDashes4[] = {4.0, 2.0, 6.0};
auto effect1 = DlDashPathEffect::Make(TestDashes1, 2, 0.0);
auto effect2 = DlDashPathEffect::Make(TestDashes2, 2, 0.0);
auto effect3 = DlDashPathEffect::Make(TestDashes3, 2, 0.0);
auto effect4 = DlDashPathEffect::Make(TestDashes4, 3, 0.0);
auto effect5 = DlDashPathEffect::Make(TestDashes1, 2, 1.0);
TestNotEquals(*effect1, *effect2, "Interval 1 differs");
TestNotEquals(*effect1, *effect3, "Interval 2 differs");
TestNotEquals(*effect1, *effect4, "Dash count differs");
TestNotEquals(*effect1, *effect5, "Dash phase differs");
d727302
to
ab0a620
Compare
@chinmaygarde done. |
ab0a620
to
417c862
Compare
…bug; update test cases
417c862
to
563d368
Compare
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.
Really all just nits - include file over-including in most places.
Upgrading the DlStreamDispatcher::setPathEffect doesn't really fix/break anything, but it would be nice for new test writers to see the contents - and this PR is all about making it easy to see the contents.
(To see what the output looks like, I usually go to the dl_unittest that constructs a giant DL of every op (see
engine/display_list/display_list_unittests.cc
Line 1028 in 0673b78
sk_sp<DisplayList> default_dl = Build(allGroups.size(), 0); |
FML_LOG(ERROR) << default_dl;
line and that shows how all of the various DL ops show up in an output stream. Then just run the display_list_unittests and adjust the output until I'm happy.)
@@ -5,12 +5,14 @@ | |||
#ifndef FLUTTER_DISPLAY_LIST_DISPLAY_LIST_PAINT_H_ | |||
#define FLUTTER_DISPLAY_LIST_DISPLAY_LIST_PAINT_H_ | |||
|
|||
#include <memory> |
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.
Is this used?
#ifndef FLUTTER_DISPLAY_LIST_DISPLAY_LIST_PATH_EFFECT_H_ | ||
#define FLUTTER_DISPLAY_LIST_DISPLAY_LIST_PATH_EFFECT_H_ | ||
|
||
#include <cstring> |
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.
Is this used?
ASSERT_NE(path_effect.shared().get(), &path_effect); | ||
ASSERT_EQ(*path_effect.shared(), path_effect); | ||
} | ||
|
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 - other files have an "UnknownAsNone" test that verifies that all of the "asFoo()" methods return nullptr...
@@ -25,7 +25,9 @@ | |||
#include "third_party/skia/include/core/SkShader.h" | |||
#include "third_party/skia/include/core/SkTextBlob.h" | |||
#include "third_party/skia/include/core/SkVertices.h" | |||
#include "third_party/skia/include/effects/SkCornerPathEffect.h" |
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 don't think this is used any more.
@@ -4,6 +4,7 @@ | |||
|
|||
#pragma once | |||
|
|||
#include "display_list/display_list_path_effect.h" |
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.
Shouldn't this be relative to "flutter/display_list" as the others?
@@ -6,6 +6,7 @@ | |||
|
|||
#include <optional> | |||
|
|||
#include "display_list/display_list_path_effect.h" |
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.
This shouldn't be needed as it will be included in the impeller/dl_dispatcher.h above.
@@ -479,7 +479,7 @@ void DisplayListStreamDispatcher::setBlendMode(DlBlendMode mode) { | |||
void DisplayListStreamDispatcher::setBlender(sk_sp<SkBlender> blender) { | |||
startl() << "setBlender(" << blender << ");" << std::endl; | |||
} | |||
void DisplayListStreamDispatcher::setPathEffect(sk_sp<SkPathEffect> effect) { | |||
void DisplayListStreamDispatcher::setPathEffect(const DlPathEffect* effect) { |
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.
This could be expanded to be more descriptive now that we can inspect the DlPathEffect.
@@ -9,6 +9,7 @@ | |||
|
|||
#include "flutter/display_list/display_list.h" | |||
#include "flutter/display_list/display_list_dispatcher.h" | |||
#include "flutter/display_list/display_list_path_effect.h" |
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.
This should come for free from the dl_dispatcher include.
This reverts commit b8ca6a5.
Use DlPathEffect Object to replace SkPathEffect Object
impeller
DLDispatcherSkPathEffect
toflutter::DlPathEffect