Narrow retained stroke preview execution
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "assets/image_pixels.h"
|
||||
#include "legacy_canvas_stroke_commit_services.h"
|
||||
#include "legacy_node_stroke_preview_execution_services.h"
|
||||
#include "paint_renderer/compositor.h"
|
||||
#include "renderer_api/recording_renderer.h"
|
||||
#include "test_harness.h"
|
||||
@@ -2011,6 +2012,48 @@ void plans_stroke_preview_composite_with_all_retained_inputs(pp::tests::Harness&
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::mixer, 3));
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_feedback_adapter_clamps_invalid_extent(pp::tests::Harness& h)
|
||||
{
|
||||
const auto fetch = pp::panopainter::plan_legacy_node_stroke_preview_feedback(
|
||||
RenderDeviceFeatures { .framebuffer_fetch = true },
|
||||
32,
|
||||
16);
|
||||
PP_EXPECT(h, fetch.path == StrokeCompositePath::framebuffer_fetch);
|
||||
PP_EXPECT(h, fetch.reads_destination_color);
|
||||
PP_EXPECT(h, !fetch.requires_auxiliary_texture);
|
||||
PP_EXPECT(h, !fetch.compatibility_fallback);
|
||||
|
||||
const auto fallback = pp::panopainter::plan_legacy_node_stroke_preview_feedback(
|
||||
RenderDeviceFeatures { .texture_copy = true },
|
||||
-32,
|
||||
16);
|
||||
PP_EXPECT(h, fallback.path == StrokeCompositePath::ping_pong_textures);
|
||||
PP_EXPECT(h, !fallback.reads_destination_color);
|
||||
PP_EXPECT(h, fallback.requires_auxiliary_texture);
|
||||
PP_EXPECT(h, !fallback.requires_texture_copy);
|
||||
PP_EXPECT(h, !fallback.requires_render_target_blit);
|
||||
PP_EXPECT(h, fallback.compatibility_fallback);
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_composite_adapter_preserves_retained_inputs(pp::tests::Harness& h)
|
||||
{
|
||||
const auto plan = pp::panopainter::plan_legacy_node_stroke_preview_composite(
|
||||
true,
|
||||
true,
|
||||
true);
|
||||
|
||||
expect_preview_sequence(h, plan);
|
||||
PP_EXPECT(h, plan.uses_mixer);
|
||||
PP_EXPECT(h, plan.uses_dual);
|
||||
PP_EXPECT(h, plan.uses_pattern);
|
||||
PP_EXPECT(h, plan.texture_slot_count == 5U);
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::background, 0));
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::stroke, 1));
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::dual, 3));
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::pattern, 4));
|
||||
PP_EXPECT(h, has_preview_texture_slot(plan, StrokePreviewTextureRole::mixer, 3));
|
||||
}
|
||||
|
||||
void plans_canvas_blend_gate_from_persisted_indices(pp::tests::Harness& h)
|
||||
{
|
||||
const std::vector<int> normal_layers { 0, 0, 0 };
|
||||
@@ -2450,6 +2493,12 @@ int main()
|
||||
harness.run(
|
||||
"plans_stroke_preview_composite_with_all_retained_inputs",
|
||||
plans_stroke_preview_composite_with_all_retained_inputs);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_feedback_adapter_clamps_invalid_extent",
|
||||
legacy_node_stroke_preview_feedback_adapter_clamps_invalid_extent);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_composite_adapter_preserves_retained_inputs",
|
||||
legacy_node_stroke_preview_composite_adapter_preserves_retained_inputs);
|
||||
harness.run("plans_canvas_blend_gate_from_persisted_indices", plans_canvas_blend_gate_from_persisted_indices);
|
||||
harness.run("canvas_blend_gate_preserves_legacy_fallbacks", canvas_blend_gate_preserves_legacy_fallbacks);
|
||||
harness.run("plans_canvas_stroke_feedback_paths", plans_canvas_stroke_feedback_paths);
|
||||
|
||||
Reference in New Issue
Block a user