Blender
V3.3
|
Classes | |
struct | PartialUpdateRegion |
A region to update. More... | |
class | AbstractTileData |
Abstract class to load tile data when using the PartialUpdateChecker. More... | |
class | NoTileData |
Class to not load any tile specific data when iterating over changes. More... | |
class | ImageTileData |
Load the ImageTile and ImBuf associated with the partial change. More... | |
struct | PartialUpdateChecker |
struct | PartialUpdateUserImpl |
struct | TileChangeset |
Dirty chunks of an ImageTile. More... | |
struct | Changeset |
Changeset keeping track of changes for an image. More... | |
struct | PartialUpdateRegisterImpl |
Partial update changes stored inside the image runtime. More... | |
class | ImagePartialUpdateTest |
Typedefs | |
using | TileNumber = int32_t |
using | ChangesetID = int64_t |
Enumerations | |
enum class | ePartialUpdateCollectResult { FullUpdateNeeded , NoChangesDetected , PartialChangesDetected } |
Result codes of #BKE_image_partial_update_collect_changes. More... | |
enum class | ePartialUpdateIterResult { Finished = 0 , ChangeAvailable = 1 } |
Return codes of #BKE_image_partial_update_get_next_change. More... | |
Functions | |
ePartialUpdateCollectResult | BKE_image_partial_update_collect_changes (struct Image *image, struct PartialUpdateUser *user) |
collect the partial update since the last request. More... | |
ePartialUpdateIterResult | BKE_image_partial_update_get_next_change (struct PartialUpdateUser *user, struct PartialUpdateRegion *r_region) |
static int | chunk_number_for_pixel (int pixel_offset) |
get the chunk number for the give pixel coordinate. More... | |
static struct PartialUpdateUser * | wrap (PartialUpdateUserImpl *user) |
static PartialUpdateUserImpl * | unwrap (struct PartialUpdateUser *user) |
static struct PartialUpdateRegister * | wrap (PartialUpdateRegisterImpl *partial_update_register) |
static PartialUpdateRegisterImpl * | unwrap (struct PartialUpdateRegister *partial_update_register) |
static PartialUpdateRegister * | image_partial_update_register_ensure (Image *image) |
TEST_F (ImagePartialUpdateTest, mark_full_update) | |
TEST_F (ImagePartialUpdateTest, mark_single_tile) | |
TEST_F (ImagePartialUpdateTest, mark_unconnected_tiles) | |
TEST_F (ImagePartialUpdateTest, donot_mark_outside_image) | |
TEST_F (ImagePartialUpdateTest, mark_inside_image) | |
TEST_F (ImagePartialUpdateTest, sequential_mark_region) | |
TEST_F (ImagePartialUpdateTest, mark_multiple_chunks) | |
TEST_F (ImagePartialUpdateTest, iterator) | |
Variables | |
constexpr int | CHUNK_SIZE = 256 |
Size of chunks to track changes. More... | |
constexpr int | MAX_HISTORY_LEN = 4 |
Max number of changesets to keep in history. More... | |
constexpr ChangesetID | UnknownChangesetID = -1 |
constexpr float | black_color [4] = {0.0f, 0.0f, 0.0f, 1.0f} |
using blender::bke::image::partial_update::ChangesetID = typedef int64_t |
Definition at line 129 of file image_partial_update.cc.
using blender::bke::image::partial_update::TileNumber = typedef int32_t |
Definition at line 128 of file image_partial_update.cc.
Result codes of BKE_image_partial_update_collect_changes.
Image partial updates.
Definition at line 40 of file BKE_image_partial_update.hh.
Return codes of BKE_image_partial_update_get_next_change.
Enumerator | |
---|---|
Finished | no tiles left when iterating over tiles. |
ChangeAvailable | a chunk was available and has been loaded. |
Definition at line 71 of file BKE_image_partial_update.hh.
ePartialUpdateCollectResult blender::bke::image::partial_update::BKE_image_partial_update_collect_changes | ( | struct Image * | image, |
struct PartialUpdateUser * | user | ||
) |
collect the partial update since the last request.
Invoke BKE_image_partial_update_get_next_change to iterate over the collected tiles.
Definition at line 469 of file image_partial_update.cc.
References BLI_assert, BLI_rcti_init(), blender::bke::image::partial_update::PartialUpdateRegisterImpl::can_construct(), blender::bke::image::partial_update::PartialUpdateRegisterImpl::changed_tile_chunks_since(), CHUNK_SIZE, blender::bke::image::partial_update::PartialUpdateUserImpl::clear_updated_regions(), blender::bke::image::partial_update::PartialUpdateRegisterImpl::ensure_empty_changeset(), FullUpdateNeeded, image(), image_partial_update_register_ensure(), blender::bke::image::partial_update::PartialUpdateUserImpl::last_changeset_id, blender::bke::image::partial_update::PartialUpdateRegisterImpl::last_changeset_id, LISTBASE_FOREACH, NoChangesDetected, PartialChangesDetected, blender::bke::image::partial_update::PartialUpdateRegion::region, tile, blender::bke::image::partial_update::PartialUpdateRegion::tile_number, unwrap(), and blender::bke::image::partial_update::PartialUpdateUserImpl::updated_regions.
Referenced by blender::bke::image::partial_update::PartialUpdateChecker< TileData >::collect_changes(), and TEST_F().
ePartialUpdateIterResult blender::bke::image::partial_update::BKE_image_partial_update_get_next_change | ( | struct PartialUpdateUser * | user, |
struct PartialUpdateRegion * | r_region | ||
) |
Definition at line 527 of file image_partial_update.cc.
References ChangeAvailable, Finished, unwrap(), and blender::bke::image::partial_update::PartialUpdateUserImpl::updated_regions.
Referenced by blender::bke::image::partial_update::PartialUpdateChecker< TileData >::CollectResult::get_next_change(), and TEST_F().
|
static |
get the chunk number for the give pixel coordinate.
As chunks are squares the this member can be used for both x and y axis.
Definition at line 84 of file image_partial_update.cc.
References CHUNK_SIZE.
Referenced by blender::bke::image::partial_update::TileChangeset::mark_region().
|
static |
Definition at line 459 of file image_partial_update.cc.
References image(), and wrap().
Referenced by BKE_image_partial_update_collect_changes(), BKE_image_partial_update_mark_full_update(), and BKE_image_partial_update_mark_region().
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
donot_mark_outside_image | |||
) |
Definition at line 177 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), EXPECT_EQ(), FullUpdateNeeded, image(), NoChangesDetected, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
iterator | |||
) |
Definition at line 358 of file image_partial_update_test.cc.
References BKE_image_partial_update_mark_region(), BLI_rcti_init(), BLI_rcti_isect(), ChangeAvailable, blender::bke::image::partial_update::PartialUpdateChecker< TileData >::CollectResult::changed_region, blender::bke::image::partial_update::PartialUpdateChecker< TileData >::collect_changes(), EXPECT_EQ(), FullUpdateNeeded, blender::bke::image::partial_update::PartialUpdateChecker< TileData >::CollectResult::get_next_change(), blender::bke::image::partial_update::PartialUpdateChecker< TileData >::CollectResult::get_result_code(), image(), NoChangesDetected, PartialChangesDetected, and blender::bke::image::partial_update::PartialUpdateRegion::region.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
mark_full_update | |||
) |
Definition at line 87 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_mark_full_update(), EXPECT_EQ(), FullUpdateNeeded, image(), NoChangesDetected, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
mark_inside_image | |||
) |
Definition at line 232 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), EXPECT_EQ(), FullUpdateNeeded, image(), NoChangesDetected, PartialChangesDetected, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
mark_multiple_chunks | |||
) |
Definition at line 328 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_get_next_change(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), BLI_rcti_isect(), ChangeAvailable, EXPECT_EQ(), FullUpdateNeeded, image(), NoChangesDetected, PartialChangesDetected, blender::bke::image::partial_update::PartialUpdateRegion::region, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
mark_single_tile | |||
) |
Definition at line 107 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_get_next_change(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), BLI_rcti_inside_rcti(), ChangeAvailable, EXPECT_EQ(), Finished, FullUpdateNeeded, image(), NoChangesDetected, PartialChangesDetected, blender::bke::image::partial_update::PartialUpdateRegion::region, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
mark_unconnected_tiles | |||
) |
Definition at line 139 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_get_next_change(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), BLI_rcti_inside_rcti(), ChangeAvailable, EXPECT_EQ(), Finished, FullUpdateNeeded, image(), NoChangesDetected, PartialChangesDetected, blender::bke::image::partial_update::PartialUpdateRegion::region, and result.
blender::bke::image::partial_update::TEST_F | ( | ImagePartialUpdateTest | , |
sequential_mark_region | |||
) |
Definition at line 271 of file image_partial_update_test.cc.
References BKE_image_partial_update_collect_changes(), BKE_image_partial_update_get_next_change(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), BLI_rcti_inside_rcti(), ChangeAvailable, EXPECT_EQ(), Finished, FullUpdateNeeded, image(), NoChangesDetected, PartialChangesDetected, blender::bke::image::partial_update::PartialUpdateRegion::region, and result.
|
static |
Unwrap the PartialUpdateRegister C-struct to its CPP counterpart (PartialUpdateRegisterImpl).
Definition at line 123 of file image_partial_update.cc.
|
static |
Unwrap the PartialUpdateUser C-struct to its CPP counterpart (PartialUpdateUserImpl).
Definition at line 107 of file image_partial_update.cc.
Referenced by BKE_image_partial_update_collect_changes(), BKE_image_partial_update_free(), BKE_image_partial_update_get_next_change(), BKE_image_partial_update_mark_full_update(), BKE_image_partial_update_mark_region(), BKE_image_partial_update_register_free(), GPU_context_active_set(), GPU_context_begin_frame(), GPU_context_discard(), GPU_context_end_frame(), GPU_indexbuf_bind_as_ssbo(), GPU_indexbuf_build_in_place(), GPU_indexbuf_create_subrange_in_place(), GPU_indexbuf_discard(), GPU_indexbuf_is_init(), GPU_indexbuf_read(), GPU_indexbuf_unmap(), GPU_indexbuf_update_sub(), and GPU_indexbuf_use().
|
static |
Wrap PartialUpdateRegisterImpl to its C-struct (PartialUpdateRegister).
Definition at line 115 of file image_partial_update.cc.
|
static |
Wrap PartialUpdateUserImpl to its C-struct (PartialUpdateUser).
Definition at line 99 of file image_partial_update.cc.
Referenced by blender::ed::curves::any_point_selected(), BKE_image_partial_update_create(), BKE_image_stamp_buf(), blf_font_wrap_apply(), blinn_specular(), BPy_IDGroup_MapDataToPy(), GeometrySet::compute_boundbox_without_instances(), blender::bke::construct_curve_length_gvarray(), blender::nodes::node_geo_input_tangent_cc::construct_curve_tangent_gvarray(), blender::bke::curve_normals_varray(), blender::ed::curves::convert_from_particle_system::curves_convert_from_particle_system_exec(), blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), do_2d_mapping(), do_text_effect(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_curve(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_curve_tasks(), blender::nodes::node_geo_curve_spline_parameter_cc::CurveParameterFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_spline_parameter_cc::CurveLengthParameterFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_spline_parameter_cc::IndexOnSplineFieldInput::get_varray_for_context(), GPU_context_active_get(), GPU_context_create(), GPU_indexbuf_calloc(), blender::ed::curves::has_anything_selected(), idprop_py_from_idp_idparray(), image_partial_update_register_ensure(), metadata_box_height_get(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::geometry::preprocess_curves(), blender::io::usd::USDCurvesReader::read_curve_sample(), GeometryComponentEditData::remember_deformed_curve_positions_if_necessary(), blender::geometry::resample_to_evaluated(), blender::ed::sculpt_paint::retrieve_selected_curves(), blender::ed::sculpt_paint::retrieve_selected_points(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::curves::select_all::select_all_exec(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::ed::sculpt_paint::select_grow::select_grow_modal(), blender::ed::sculpt_paint::select_grow::select_grow_update(), blender::ed::curves::snap_curves_to_surface::snap_curves_to_surface_exec_object(), txt_find_string(), blender::ed::sculpt_paint::use_add_density_mode(), WM_cursor_grab_enable(), wm_macro_modal(), and wm_operator_invoke().
|
constexpr |
Definition at line 23 of file image_partial_update_test.cc.
|
constexpr |
Size of chunks to track changes.
Definition at line 65 of file image_partial_update.cc.
Referenced by BKE_image_partial_update_collect_changes(), chunk_number_for_pixel(), and blender::bke::image::partial_update::TileChangeset::update_resolution().
|
constexpr |
Max number of changesets to keep in history.
A higher number would need more memory and processing to calculate a changeset, but would lead to do partial updates for requests that don't happen every frame.
A to small number would lead to more full updates when changes couldn't be reconstructed from the available history.
Definition at line 77 of file image_partial_update.cc.
Referenced by blender::bke::image::partial_update::PartialUpdateRegisterImpl::limit_history().
|
constexpr |
Definition at line 130 of file image_partial_update.cc.