Use new DlBlendMode Object (#32026)
diff --git a/display_list/display_list_builder.cc b/display_list/display_list_builder.cc
index 0d4f3bb..be2f60b 100644
--- a/display_list/display_list_builder.cc
+++ b/display_list/display_list_builder.cc
@@ -4,6 +4,7 @@
#include "flutter/display_list/display_list_builder.h"
+#include "flutter/display_list/display_list_blend_mode.h"
#include "flutter/display_list/display_list_ops.h"
namespace flutter {
@@ -103,7 +104,7 @@
void DisplayListBuilder::onSetColor(SkColor color) {
Push<SetColorOp>(0, 0, current_color_ = color);
}
-void DisplayListBuilder::onSetBlendMode(SkBlendMode mode) {
+void DisplayListBuilder::onSetBlendMode(DlBlendMode mode) {
current_blender_ = nullptr;
Push<SetBlendModeOp>(0, 0, current_blend_mode_ = mode);
UpdateCurrentOpacityCompatibility();
@@ -115,7 +116,7 @@
SkPaint p;
p.setBlender(blender);
if (p.asBlendMode()) {
- setBlendMode(p.asBlendMode().value());
+ setBlendMode(ToDl(p.asBlendMode().value()));
} else {
// |current_blender_| supersedes any value of |current_blend_mode_|
(current_blender_ = blender) //
@@ -263,7 +264,7 @@
if (flags.applies_blend()) {
std::optional<SkBlendMode> mode_optional = paint.asBlendMode();
if (mode_optional) {
- setBlendMode(mode_optional.value());
+ setBlendMode(ToDl(mode_optional.value()));
} else {
setBlender(sk_ref_sp(paint.getBlender()));
}
@@ -479,7 +480,7 @@
Push<DrawPaintOp>(0, 1);
CheckLayerOpacityCompatibility();
}
-void DisplayListBuilder::drawColor(SkColor color, SkBlendMode mode) {
+void DisplayListBuilder::drawColor(SkColor color, DlBlendMode mode) {
Push<DrawColorOp>(0, 1, color, mode);
CheckLayerOpacityCompatibility(mode);
}
@@ -559,7 +560,7 @@
UpdateLayerOpacityCompatibility(false);
}
void DisplayListBuilder::drawVertices(const sk_sp<SkVertices> vertices,
- SkBlendMode mode) {
+ DlBlendMode mode) {
Push<DrawVerticesOp>(0, 1, std::move(vertices), mode);
// DrawVertices applies its colors to the paint so we have no way
// of controlling opacity using the current paint attributes.
@@ -625,7 +626,7 @@
const SkRect tex[],
const SkColor colors[],
int count,
- SkBlendMode mode,
+ DlBlendMode mode,
const SkSamplingOptions& sampling,
const SkRect* cull_rect,
bool render_with_attributes) {