Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions display_list/benchmarking/dl_benchmarks.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion display_list/benchmarking/dl_complexity_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DisplayListGLComplexityCalculator
private:
class GLHelper : public ComplexityCalculatorHelper {
public:
GLHelper(unsigned int ceiling)
explicit GLHelper(unsigned int ceiling)
: ComplexityCalculatorHelper(ceiling),
save_layer_count_(0),
draw_text_blob_count_(0) {}
Expand Down
8 changes: 4 additions & 4 deletions display_list/benchmarking/dl_complexity_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ class ComplexityCalculatorHelper
public virtual IgnoreClipDispatchHelper,
public virtual IgnoreTransformDispatchHelper {
public:
ComplexityCalculatorHelper(unsigned int ceiling)
: is_complex_(false), ceiling_(ceiling), complexity_score_(0) {}
explicit ComplexityCalculatorHelper(unsigned int ceiling)
: ceiling_(ceiling) {}

virtual ~ComplexityCalculatorHelper() = default;

Expand Down Expand Up @@ -261,10 +261,10 @@ class ComplexityCalculatorHelper
// If we exceed the ceiling (defaults to the largest number representable
// by unsigned int), then set the is_complex_ bool and we no longer
// accumulate.
bool is_complex_;
bool is_complex_ = false;
unsigned int ceiling_;

unsigned int complexity_score_;
unsigned int complexity_score_ = 0;
};

} // namespace flutter
Expand Down
10 changes: 4 additions & 6 deletions display_list/benchmarking/dl_complexity_metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ class DisplayListMetalComplexityCalculator
private:
class MetalHelper : public ComplexityCalculatorHelper {
public:
MetalHelper(unsigned int ceiling)
: ComplexityCalculatorHelper(ceiling),
save_layer_count_(0),
draw_text_blob_count_(0) {}
explicit MetalHelper(unsigned int ceiling)
: ComplexityCalculatorHelper(ceiling) {}

void saveLayer(const SkRect* bounds,
const SaveLayerOptions options,
Expand Down Expand Up @@ -85,8 +83,8 @@ class DisplayListMetalComplexityCalculator
unsigned int BatchedComplexity() override;

private:
unsigned int save_layer_count_;
unsigned int draw_text_blob_count_;
unsigned int save_layer_count_ = 0;
unsigned int draw_text_blob_count_ = 0;
};

DisplayListMetalComplexityCalculator()
Expand Down
2 changes: 1 addition & 1 deletion display_list/dl_op_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DisplayListSpecialGeometryFlags DisplayListAttributeFlags::WithPathEffect(
// end caps to areas that might not have had them before so all
// we need to do is to indicate the potential for diagonal
// end caps and move on.
return special_flags_.with(kMayHaveCaps_ | kMayHaveDiagonalCaps_);
return special_flags_.with(kMayHaveCaps | kMayHaveDiagonalCaps);
}
}
}
Expand Down
334 changes: 167 additions & 167 deletions display_list/dl_op_flags.h

Large diffs are not rendered by default.

47 changes: 24 additions & 23 deletions display_list/dl_op_records.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ DEFINE_SET_CLEAR_DLATTR_OP(PathEffect, PathEffect, effect)
struct SetImageColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetImageColorSource;

SetImageColorSourceOp(const DlImageColorSource* source)
explicit SetImageColorSourceOp(const DlImageColorSource* source)
: source(source->image(),
source->horizontal_tile_mode(),
source->vertical_tile_mode(),
Expand All @@ -254,7 +254,8 @@ struct SetImageColorSourceOp : DLOp {
struct SetRuntimeEffectColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetRuntimeEffectColorSource;

SetRuntimeEffectColorSourceOp(const DlRuntimeEffectColorSource* source)
explicit SetRuntimeEffectColorSourceOp(
const DlRuntimeEffectColorSource* source)
: source(source->runtime_effect(),
source->samplers(),
source->uniform_data()) {}
Expand Down Expand Up @@ -295,7 +296,7 @@ struct SetSceneColorSourceOp : DLOp {
struct SetSharedImageFilterOp : DLOp {
static const auto kType = DisplayListOpType::kSetSharedImageFilter;

SetSharedImageFilterOp(const DlImageFilter* filter)
explicit SetSharedImageFilterOp(const DlImageFilter* filter)
: filter(filter->shared()) {}

const std::shared_ptr<DlImageFilter> filter;
Expand All @@ -315,7 +316,7 @@ struct SetSharedImageFilterOp : DLOp {
struct SaveOpBase : DLOp {
SaveOpBase() : options(), restore_index(0) {}

SaveOpBase(const SaveLayerOptions options)
explicit SaveOpBase(const SaveLayerOptions& options)
: options(options), restore_index(0) {}

// options parameter is only used by saveLayer operations, but since
Expand Down Expand Up @@ -347,7 +348,7 @@ struct SaveOp final : SaveOpBase {
struct SaveLayerOp final : SaveOpBase {
static const auto kType = DisplayListOpType::kSaveLayer;

explicit SaveLayerOp(const SaveLayerOptions options) : SaveOpBase(options) {}
explicit SaveLayerOp(const SaveLayerOptions& options) : SaveOpBase(options) {}

void dispatch(DispatchContext& ctx) const {
if (save_needed(ctx)) {
Expand All @@ -359,7 +360,7 @@ struct SaveLayerOp final : SaveOpBase {
struct SaveLayerBoundsOp final : SaveOpBase {
static const auto kType = DisplayListOpType::kSaveLayerBounds;

SaveLayerBoundsOp(const SaveLayerOptions options, const SkRect& rect)
SaveLayerBoundsOp(const SaveLayerOptions& options, const SkRect& rect)
: SaveOpBase(options), rect(rect) {}

const SkRect rect;
Expand All @@ -374,7 +375,7 @@ struct SaveLayerBoundsOp final : SaveOpBase {
struct SaveLayerBackdropOp final : SaveOpBase {
static const auto kType = DisplayListOpType::kSaveLayerBackdrop;

explicit SaveLayerBackdropOp(const SaveLayerOptions options,
explicit SaveLayerBackdropOp(const SaveLayerOptions& options,
const DlImageFilter* backdrop)
: SaveOpBase(options), backdrop(backdrop->shared()) {}

Expand All @@ -396,7 +397,7 @@ struct SaveLayerBackdropOp final : SaveOpBase {
struct SaveLayerBackdropBoundsOp final : SaveOpBase {
static const auto kType = DisplayListOpType::kSaveLayerBackdropBounds;

SaveLayerBackdropBoundsOp(const SaveLayerOptions options,
SaveLayerBackdropBoundsOp(const SaveLayerOptions& options,
const SkRect& rect,
const DlImageFilter* backdrop)
: SaveOpBase(options), rect(rect), backdrop(backdrop->shared()) {}
Expand Down Expand Up @@ -603,7 +604,7 @@ DEFINE_CLIP_SHAPE_OP(RRect, Difference)
struct Clip##clipop##PathOp final : TransformClipOpBase { \
static const auto kType = DisplayListOpType::kClip##clipop##Path; \
\
Clip##clipop##PathOp(SkPath path, bool is_aa) \
Clip##clipop##PathOp(const SkPath& path, bool is_aa) \
: is_aa(is_aa), path(path) {} \
\
const bool is_aa; \
Expand Down Expand Up @@ -689,7 +690,7 @@ DEFINE_DRAW_1ARG_OP(RRect, SkRRect, rrect)
struct DrawPathOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawPath;

explicit DrawPathOp(SkPath path) : path(path) {}
explicit DrawPathOp(const SkPath& path) : path(path) {}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be a move?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No apparently:

Screenshot 2023-09-21 at 1 14 23 PM


const SkPath path;

Expand Down Expand Up @@ -787,7 +788,7 @@ DEFINE_DRAW_POINTS_OP(Polygon, kPolygon);
struct DrawVerticesOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawVertices;

DrawVerticesOp(DlBlendMode mode) : mode(mode) {}
explicit DrawVerticesOp(DlBlendMode mode) : mode(mode) {}

const DlBlendMode mode;

Expand All @@ -806,7 +807,7 @@ struct DrawVerticesOp final : DrawOpBase {
struct name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage> image, \
name##Op(const sk_sp<DlImage>& image, \
const SkPoint& point, \
DlImageSampling sampling) \
: point(point), sampling(sampling), image(std::move(image)) {} \
Expand Down Expand Up @@ -837,7 +838,7 @@ DEFINE_DRAW_IMAGE_OP(DrawImageWithAttr, true)
struct DrawImageRectOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawImageRect;

DrawImageRectOp(const sk_sp<DlImage> image,
DrawImageRectOp(const sk_sp<DlImage>& image,
const SkRect& src,
const SkRect& dst,
DlImageSampling sampling,
Expand All @@ -848,7 +849,7 @@ struct DrawImageRectOp final : DrawOpBase {
sampling(sampling),
render_with_attributes(render_with_attributes),
constraint(constraint),
image(std::move(image)) {}
image(image) {}

const SkRect src;
const SkRect dst;
Expand Down Expand Up @@ -879,7 +880,7 @@ struct DrawImageRectOp final : DrawOpBase {
struct name##Op final : DrawOpBase { \
static const auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage> image, \
name##Op(const sk_sp<DlImage>& image, \
const SkIRect& center, \
const SkRect& dst, \
DlFilterMode mode) \
Expand Down Expand Up @@ -916,7 +917,7 @@ DEFINE_DRAW_IMAGE_NINE_OP(DrawImageNineWithAttr, true)
// DlColor list only packs well if the count is even, otherwise there
// can be 4 unusued bytes at the end.
struct DrawAtlasBaseOp : DrawOpBase {
DrawAtlasBaseOp(const sk_sp<DlImage> atlas,
DrawAtlasBaseOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
Expand All @@ -927,7 +928,7 @@ struct DrawAtlasBaseOp : DrawOpBase {
has_colors(has_colors),
render_with_attributes(render_with_attributes),
sampling(sampling),
atlas(std::move(atlas)) {}
atlas(atlas) {}

const int count;
const uint16_t mode_index;
Expand Down Expand Up @@ -959,7 +960,7 @@ struct DrawAtlasBaseOp : DrawOpBase {
struct DrawAtlasOp final : DrawAtlasBaseOp {
static const auto kType = DisplayListOpType::kDrawAtlas;

DrawAtlasOp(const sk_sp<DlImage> atlas,
DrawAtlasOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
Expand Down Expand Up @@ -1000,7 +1001,7 @@ struct DrawAtlasOp final : DrawAtlasBaseOp {
struct DrawAtlasCulledOp final : DrawAtlasBaseOp {
static const auto kType = DisplayListOpType::kDrawAtlasCulled;

DrawAtlasCulledOp(const sk_sp<DlImage> atlas,
DrawAtlasCulledOp(const sk_sp<DlImage>& atlas,
int count,
DlBlendMode mode,
DlImageSampling sampling,
Expand Down Expand Up @@ -1044,9 +1045,9 @@ struct DrawAtlasCulledOp final : DrawAtlasBaseOp {
struct DrawDisplayListOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawDisplayList;

explicit DrawDisplayListOp(const sk_sp<DisplayList> display_list,
explicit DrawDisplayListOp(const sk_sp<DisplayList>& display_list,
SkScalar opacity)
: opacity(opacity), display_list(std::move(display_list)) {}
: opacity(opacity), display_list(display_list) {}

SkScalar opacity;
const sk_sp<DisplayList> display_list;
Expand All @@ -1070,8 +1071,8 @@ struct DrawDisplayListOp final : DrawOpBase {
struct DrawTextBlobOp final : DrawOpBase {
static const auto kType = DisplayListOpType::kDrawTextBlob;

DrawTextBlobOp(const sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y)
: x(x), y(y), blob(std::move(blob)) {}
DrawTextBlobOp(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y)
: x(x), y(y), blob(blob) {}

const SkScalar x;
const SkScalar y;
Expand Down
2 changes: 1 addition & 1 deletion display_list/effects/dl_image_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ class DlColorFilterImageFilter final : public DlImageFilter {
: DlColorFilterImageFilter(&filter) {}

static std::shared_ptr<DlImageFilter> Make(
std::shared_ptr<const DlColorFilter> filter) {
const std::shared_ptr<const DlColorFilter>& filter) {
if (filter) {
return std::make_shared<DlColorFilterImageFilter>(filter);
}
Expand Down
4 changes: 2 additions & 2 deletions display_list/skia/dl_sk_paint_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace flutter {
// which can be accessed at any time via paint().
class DlSkPaintDispatchHelper : public virtual DlOpReceiver {
public:
DlSkPaintDispatchHelper(SkScalar opacity = SK_Scalar1)
explicit DlSkPaintDispatchHelper(SkScalar opacity = SK_Scalar1)
: current_color_(SK_ColorBLACK), opacity_(opacity) {
if (opacity < SK_Scalar1) {
paint_.setAlphaf(opacity);
Expand Down Expand Up @@ -76,7 +76,7 @@ class DlSkPaintDispatchHelper : public virtual DlOpReceiver {
sk_sp<SkColorFilter> makeColorFilter() const;

struct SaveInfo {
SaveInfo(SkScalar opacity) : opacity(opacity) {}
explicit SaveInfo(SkScalar opacity) : opacity(opacity) {}

SkScalar opacity;
};
Expand Down
Loading