summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fd5a05)
raw | patch | inline | side by side (parent: 3fd5a05)
author | kiirala <kiirala@users.sourceforge.net> | |
Sat, 12 Jan 2008 18:38:39 +0000 (18:38 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Sat, 12 Jan 2008 18:38:39 +0000 (18:38 +0000) |
src/display/nr-filter-slot.cpp | patch | blob | history | |
src/display/nr-filter-types.h | patch | blob | history |
index e6a78c8c7089c275fc3388f5743a0ae221e8c5a5..0cbf88e02181d12027a24ab0c572872eaf644f01 100644 (file)
void FilterSlot::set(int slot_nr, NRPixBlock *pb)
{
- int index = _get_index(slot_nr);
+ /* Unnamed slot is for saving filter primitive results, when parameter
+ * 'result' is not set. Only the filter immediately after this one
+ * can access unnamed results, so we don't have to worry about overwriting
+ * previous results in filter chain. On the other hand, we may not
+ * overwrite any other image with this one, because they might be
+ * accessed later on. */
+ int index = ((slot_nr != NR_FILTER_SLOT_NOT_SET)
+ ? _get_index(slot_nr)
+ : _get_index(NR_FILTER_UNNAMED_SLOT));
assert(index >= 0);
+ // Unnamed slot is only for NR::FilterSlot internal use.
+ assert(slot_nr != NR_FILTER_UNNAMED_SLOT);
assert(slot_nr == NR_FILTER_SLOT_NOT_SET ||_slot_number[index] == slot_nr);
if (slot_nr == NR_FILTER_SOURCEGRAPHIC || slot_nr == NR_FILTER_BACKGROUNDIMAGE) {
slot_nr == NR_FILTER_BACKGROUNDIMAGE ||
slot_nr == NR_FILTER_BACKGROUNDALPHA ||
slot_nr == NR_FILTER_FILLPAINT ||
- slot_nr == NR_FILTER_STROKEPAINT);
+ slot_nr == NR_FILTER_STROKEPAINT ||
+ slot_nr == NR_FILTER_UNNAMED_SLOT);
int index = -1;
if (slot_nr == NR_FILTER_SLOT_NOT_SET) {
index 0997d36f459f6af6007de419fb200d2c79c77d46..ee24840cf7def8ea5b83d80f5dfa8d52a0fda74b 100644 (file)
NR_FILTER_BACKGROUNDIMAGE = -4,
NR_FILTER_BACKGROUNDALPHA = -5,
NR_FILTER_FILLPAINT = -6,
- NR_FILTER_STROKEPAINT = -7
+ NR_FILTER_STROKEPAINT = -7,
+ NR_FILTER_UNNAMED_SLOT = -8
};
+/* Unnamed slot is for NR::FilterSlot internal use. Passing it as
+ * parameter to NR::FilterSlot accessors may have unforeseen consequences. */
} /* namespace NR */