Use blend gate plan for canvas copy decisions
This commit is contained in:
@@ -116,11 +116,22 @@ void apply_stroke_plan(CanvasBlendGatePlan& gate, const StrokeCompositePlan& str
|
||||
gate.requires_render_target_blit = stroke.requires_render_target_blit;
|
||||
}
|
||||
|
||||
void mark_shader_blend_fallback(CanvasBlendGatePlan& gate) noexcept
|
||||
void mark_shader_blend_fallback(
|
||||
CanvasBlendGatePlan& gate,
|
||||
pp::renderer::RenderDeviceFeatures features) noexcept
|
||||
{
|
||||
gate.shader_blend = true;
|
||||
gate.complex_blend = true;
|
||||
gate.compatibility_fallback = true;
|
||||
if (features.framebuffer_fetch) {
|
||||
gate.path = StrokeCompositePath::framebuffer_fetch;
|
||||
gate.reads_destination_color = true;
|
||||
} else if (features.texture_copy || features.render_target_blit) {
|
||||
gate.path = StrokeCompositePath::ping_pong_textures;
|
||||
gate.requires_auxiliary_texture = true;
|
||||
gate.requires_texture_copy = features.texture_copy;
|
||||
gate.requires_render_target_blit = !features.texture_copy && features.render_target_blit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -227,7 +238,7 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
|
||||
if (!paint_blend_mode_from_persisted_index(request.layer_blend_modes[i], layer_blend)) {
|
||||
if (request.layer_blend_modes[i] != 0) {
|
||||
gate.first_complex_layer_index = static_cast<int>(i);
|
||||
mark_shader_blend_fallback(gate);
|
||||
mark_shader_blend_fallback(gate, features);
|
||||
return pp::foundation::Result<CanvasBlendGatePlan>::success(gate);
|
||||
}
|
||||
continue;
|
||||
@@ -259,7 +270,7 @@ pp::foundation::Result<CanvasBlendGatePlan> plan_canvas_blend_gate(
|
||||
if (!stroke_blend_mode_from_persisted_index(request.stroke_blend_mode, stroke_blend)) {
|
||||
if (request.stroke_blend_mode != 0) {
|
||||
gate.stroke_complex = true;
|
||||
mark_shader_blend_fallback(gate);
|
||||
mark_shader_blend_fallback(gate, features);
|
||||
return pp::foundation::Result<CanvasBlendGatePlan>::success(gate);
|
||||
}
|
||||
} else if (stroke_blend != pp::paint::StrokeBlendMode::normal) {
|
||||
|
||||
Reference in New Issue
Block a user