-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#46120Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine team
Description
Blocks #134969.
I'm requesting help if anyone could use a simple~ish task to work on in the background.
The work required is roughly the following:
diff --git a/display_list/dl_paint.h b/display_list/dl_paint.h
index 3d9220f57e..8676cbb40e 100644
--- a/display_list/dl_paint.h
+++ b/display_list/dl_paint.h
@@ -6,6 +6,7 @@
#define FLUTTER_DISPLAY_LIST_DL_PAINT_H_
#include <memory>
+#include <utility>
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_color.h"
#include "flutter/display_list/effects/dl_color_filter.h"
@@ -52,7 +53,7 @@ class DlPaint {
static const DlPaint kDefault;
DlPaint() : DlPaint(DlColor::kBlack()) {}
- DlPaint(DlColor color);
+ explicit DlPaint(DlColor color);
bool isAntiAlias() const { return isAntiAlias_; }
DlPaint& setAntiAlias(bool isAntiAlias) {
@@ -121,80 +122,80 @@ class DlPaint {
return *this;
}
- float getStrokeWidth() const { return strokeWidth_; }
+ float getStrokeWidth() const { return stroke_width_; }
DlPaint& setStrokeWidth(float width) {
- strokeWidth_ = width;
+ stroke_width_ = width;
return *this;
}
- float getStrokeMiter() const { return strokeMiter_; }
+ float getStrokeMiter() const { return stroke_miter_; }
DlPaint& setStrokeMiter(float miter) {
- strokeMiter_ = miter;
+ stroke_miter_ = miter;
return *this;
}
std::shared_ptr<const DlColorSource> getColorSource() const {
- return colorSource_;
+ return color_source_;
}
- const DlColorSource* getColorSourcePtr() const { return colorSource_.get(); }
+ const DlColorSource* getColorSourcePtr() const { return color_source_.get(); }
DlPaint& setColorSource(std::shared_ptr<const DlColorSource> source) {
- colorSource_ = source;
+ color_source_ = std::move(source);
return *this;
}
DlPaint& setColorSource(const DlColorSource* source) {
- colorSource_ = source ? source->shared() : nullptr;
+ color_source_ = source ? source->shared() : nullptr;
return *this;
}
std::shared_ptr<const DlColorFilter> getColorFilter() const {
- return colorFilter_;
+ return color_filter_;
}
- const DlColorFilter* getColorFilterPtr() const { return colorFilter_.get(); }
- DlPaint& setColorFilter(const std::shared_ptr<const DlColorFilter> filter) {
- colorFilter_ = filter;
+ const DlColorFilter* getColorFilterPtr() const { return color_filter_.get(); }
+ DlPaint& setColorFilter(const std::shared_ptr<const DlColorFilter>& filter) {
+ color_filter_ = filter;
return *this;
}
DlPaint& setColorFilter(const DlColorFilter* filter) {
- colorFilter_ = filter ? filter->shared() : nullptr;
+ color_filter_ = filter ? filter->shared() : nullptr;
return *this;
}
std::shared_ptr<const DlImageFilter> getImageFilter() const {
- return imageFilter_;
+ return image_filter_;
}
- const DlImageFilter* getImageFilterPtr() const { return imageFilter_.get(); }
- DlPaint& setImageFilter(const std::shared_ptr<const DlImageFilter> filter) {
- imageFilter_ = filter;
+ const DlImageFilter* getImageFilterPtr() const { return image_filter_.get(); }
+ DlPaint& setImageFilter(const std::shared_ptr<const DlImageFilter>& filter) {
+ image_filter_ = filter;
return *this;
}
DlPaint& setImageFilter(const DlImageFilter* filter) {
- imageFilter_ = filter ? filter->shared() : nullptr;
+ image_filter_ = filter ? filter->shared() : nullptr;
return *this;
}
std::shared_ptr<const DlMaskFilter> getMaskFilter() const {
- return maskFilter_;
+ return mask_filter_;
}
- const DlMaskFilter* getMaskFilterPtr() const { return maskFilter_.get(); }
- DlPaint& setMaskFilter(std::shared_ptr<DlMaskFilter> filter) {
- maskFilter_ = filter;
+ const DlMaskFilter* getMaskFilterPtr() const { return mask_filter_.get(); }
+ DlPaint& setMaskFilter(const std::shared_ptr<DlMaskFilter>& filter) {
+ mask_filter_ = filter;
return *this;
}
DlPaint& setMaskFilter(const DlMaskFilter* filter) {
- maskFilter_ = filter ? filter->shared() : nullptr;
+ mask_filter_ = filter ? filter->shared() : nullptr;
return *this;
}
std::shared_ptr<const DlPathEffect> getPathEffect() const {
- return pathEffect_;
+ return path_effect_;
}
- const DlPathEffect* getPathEffectPtr() const { return pathEffect_.get(); }
- DlPaint& setPathEffect(std::shared_ptr<DlPathEffect> pathEffect) {
- pathEffect_ = pathEffect;
+ const DlPathEffect* getPathEffectPtr() const { return path_effect_.get(); }
+ DlPaint& setPathEffect(const std::shared_ptr<DlPathEffect>& pathEffect) {
+ path_effect_ = pathEffect;
return *this;
}
DlPaint& setPathEffect(const DlPathEffect* effect) {
- pathEffect_ = effect ? effect->shared() : nullptr;
+ path_effect_ = effect ? effect->shared() : nullptr;
return *this;
}
@@ -230,14 +231,14 @@ class DlPaint {
};
DlColor color_;
- float strokeWidth_;
- float strokeMiter_;
-
- std::shared_ptr<const DlColorSource> colorSource_;
- std::shared_ptr<const DlColorFilter> colorFilter_;
- std::shared_ptr<const DlImageFilter> imageFilter_;
- std::shared_ptr<const DlMaskFilter> maskFilter_;
- std::shared_ptr<const DlPathEffect> pathEffect_;
+ float stroke_width_;
+ float stroke_miter_;
+
+ std::shared_ptr<const DlColorSource> color_source_;
+ std::shared_ptr<const DlColorFilter> color_filter_;
+ std::shared_ptr<const DlImageFilter> image_filter_;
+ std::shared_ptr<const DlMaskFilter> mask_filter_;
+ std::shared_ptr<const DlPathEffect> path_effect_;
};
} // namespace flutter... and then changing the rest of the repo to use DlPaint(dl_color) explicitly.
I also included above some other style changes that are private to that header, that could be done at the same time or in a separate PR depending on your comfort level (though it doesn't seem worth it to break up into another issue).
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine team