Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d998f8c

Browse files
committed
review feedback
1 parent e58014d commit d998f8c

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

flow/display_list.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ void DisplayListBuilder::onSetBlender(sk_sp<SkBlender> blender) {
11221122
if (p.asBlendMode()) {
11231123
setBlendMode(p.asBlendMode().value());
11241124
} else {
1125+
// |current_blender_| supersedes any value of |current_blend_mode_|
11251126
(current_blender_ = blender) //
11261127
? Push<SetBlenderOp>(0, 0, std::move(blender))
11271128
: Push<ClearBlenderOp>(0, 0);

flow/display_list.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,22 +480,22 @@ class Dispatcher {
480480
class DisplayListFlags {
481481
protected:
482482
// A drawing operation that is not geometric in nature (but which
483-
// may still apply a MaskFilter - see |kApplyMaskFilter| below).
483+
// may still apply a MaskFilter - see |kUsesMaskFilter_| below).
484484
static constexpr int kIsNonGeometric_ = 0;
485485

486486
// A geometric operation that is defined as a fill operation
487487
// regardless of what the current paint Style is set to.
488-
// This flag will automatically assume |kApplyMaskFilter|.
488+
// This flag will automatically assume |kUsesMaskFilter_|.
489489
static constexpr int kIsFilledGeometry_ = 1 << 0;
490490

491491
// A geometric operation that is defined as a stroke operation
492492
// regardless of what the current paint Style is set to.
493-
// This flag will automatically assume |kApplyMaskFilter|.
493+
// This flag will automatically assume |kUsesMaskFilter_|.
494494
static constexpr int kIsStrokedGeometry_ = 1 << 1;
495495

496496
// A geometric operation that may be a stroke or fill operation
497497
// depending on the current state of the paint Style attribute.
498-
// This flag will automatically assume |kApplyMaskFilter|.
498+
// This flag will automatically assume |kUsesMaskFilter_|.
499499
static constexpr int kIsDrawnGeometry_ = 1 << 2;
500500

501501
static constexpr int kIsAnyGeometryMask_ = //
@@ -1010,12 +1010,13 @@ class DisplayListBuilder final : public virtual Dispatcher, public SkRefCnt {
10101010
bool current_dither_ = false;
10111011
bool current_invert_colors_ = false;
10121012
SkColor current_color_ = 0xFF000000;
1013-
SkBlendMode current_blend_mode_ = SkBlendMode::kSrcOver;
10141013
SkPaint::Style current_style_ = SkPaint::Style::kFill_Style;
10151014
SkScalar current_stroke_width_ = 0.0;
10161015
SkScalar current_stroke_miter_ = 4.0;
10171016
SkPaint::Cap current_stroke_cap_ = SkPaint::Cap::kButt_Cap;
10181017
SkPaint::Join current_stroke_join_ = SkPaint::Join::kMiter_Join;
1018+
// If |current_blender_| is set then |current_blend_mode_| should be ignored
1019+
SkBlendMode current_blend_mode_ = SkBlendMode::kSrcOver;
10191020
sk_sp<SkBlender> current_blender_;
10201021
sk_sp<SkShader> current_shader_;
10211022
sk_sp<SkColorFilter> current_color_filter_;

flow/display_list_utils.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ void DisplayListBoundsCalculator::saveLayer(const SkRect* bounds,
292292
if (bounds) {
293293
clipRect(*bounds, SkClipOp::kIntersect, false);
294294
}
295-
// ClipBoundsDispatchHelper::reset(bounds);
296295
}
297296
void DisplayListBoundsCalculator::restore() {
298297
if (layer_infos_.size() > 1) {

lib/ui/painting/canvas.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ fml::RefPtr<Canvas> Canvas::Create(PictureRecorder* recorder,
8282
ToDart("Canvas constructor called with non-genuine PictureRecorder."));
8383
return nullptr;
8484
}
85+
86+
// This call will implicitly initialize the |canvas_| field with an SkCanvas
87+
// whether or not we are using display_list. Now that all of the code here
88+
// in canvas.cc will direct calls to the DisplayListBuilder we could almost
89+
// stop initializing that field for the display list case. Unfortunately,
90+
// the text code in paragraph.cc still needs to present its output to an
91+
// SkCanvas* which means without significant work to the internals of the
92+
// paragraph code, we are going to continue to need the canvas adapter and
93+
// field and getter.
8594
fml::RefPtr<Canvas> canvas = fml::MakeRefCounted<Canvas>(
8695
recorder->BeginRecording(SkRect::MakeLTRB(left, top, right, bottom)));
8796
recorder->set_canvas(canvas);

0 commit comments

Comments
 (0)