diff options
-rw-r--r-- | dw/fltkimgbuf.cc | 38 | ||||
-rw-r--r-- | lout/misc.cc | 6 | ||||
-rw-r--r-- | lout/misc.hh | 2 | ||||
-rw-r--r-- | src/html.cc | 8 |
4 files changed, 51 insertions, 3 deletions
diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index 01bce455..df387dfb 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -145,6 +145,12 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, deleteOnUnref = true; copiedRows = new lout::misc::BitSet (height); + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + // The list is only used for root buffers. if (isRoot()) scaledBuffers = new lout::container::typed::List <FltkImgbuf> (true); @@ -219,6 +225,13 @@ inline void FltkImgbuf::scaleRowSimple (int row, const core::byte *data) if (copiedRows->get(sr)) continue; copiedRows->set (sr, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + if (sr == sr1) { for (int px = 0; px < root->width; px++) { int px1 = px * width / root->width; @@ -249,6 +262,12 @@ inline void FltkImgbuf::scaleRowBeautiful (int row, const core::byte *data) // Mark scaled rows done for (int sr = sr1; sr < sr2 || sr == sr1; sr++) copiedRows->set (sr, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } else { assert (sr1 == sr2 || sr1 + 1 == sr2); int row1 = backscaledY(sr1), row2 = backscaledY(sr1 + 1); @@ -263,6 +282,12 @@ inline void FltkImgbuf::scaleRowBeautiful (int row, const core::byte *data) bpp, gamma); // Mark scaled row done copiedRows->set (sr1, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } } } @@ -333,6 +358,13 @@ void FltkImgbuf::copyRow (int row, const core::byte *data) if (row < height) { // Flag the row done and copy its data. copiedRows->set (row, true); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } + memcpy(rawdata + row * width * bpp, data, width * bpp); // Update all the scaled buffers of this root image. @@ -350,6 +382,12 @@ void FltkImgbuf::newScan () for (Iterator<FltkImgbuf> it = scaledBuffers->iterator(); it.hasNext();){ FltkImgbuf *sb = it.getNext (); sb->copiedRows->clear(); + + DBG_IF_RTFL { + lout::misc::StringBuffer sb; + copiedRows->intoStringBuffer (&sb); + DBG_OBJ_SET_SYM ("copiedRows", sb.getChars ()); + } } } } diff --git a/lout/misc.cc b/lout/misc.cc index 8d630efc..9b333c93 100644 --- a/lout/misc.cc +++ b/lout/misc.cc @@ -133,6 +133,7 @@ void StringBuffer::clear () BitSet::BitSet(int initBits) { + numBits = initBits; numBytes = bytesForBits(initBits); bits = (unsigned char*)malloc(numBytes * sizeof(unsigned char)); clear(); @@ -146,7 +147,7 @@ BitSet::~BitSet() void BitSet::intoStringBuffer(misc::StringBuffer *sb) { sb->append("["); - for (int i = 0; i < numBytes; i++) + for (int i = 0; i < numBits; i++) sb->append(get(i) ? "1" : "0"); sb->append("]"); } @@ -161,6 +162,9 @@ bool BitSet::get(int i) const void BitSet::set(int i, bool val) { + if (i > numBits) + numBits = i; + if (8 * i >= numBytes) { int newNumBytes = numBytes; while (8 * i >= newNumBytes) diff --git a/lout/misc.hh b/lout/misc.hh index 1bc1c1de..18ac0802 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -581,7 +581,7 @@ class BitSet { private: unsigned char *bits; - int numBytes; + int numBits, numBytes; inline int bytesForBits(int bits) { return bits == 0 ? 1 : (bits + 7) / 8; } diff --git a/src/html.cc b/src/html.cc index ffdbcac1..82e28733 100644 --- a/src/html.cc +++ b/src/html.cc @@ -3341,7 +3341,13 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) /* Ignore LINK outside HEAD */ if (!(html->InFlags & IN_HEAD)) { - BUG_MSG("<link> must be inside the HEAD section."); + if (!((html->DocType == DT_HTML && html->DocTypeVersion >= 5.0f) && + a_Html_get_attr(html, tag, tagsize, "itemprop"))) { + /* With the HTML 5.1 draft spec, link with itemprop may appear + * in the body. + */ + BUG_MSG("This <link> element must be inside the HEAD section."); + } return; } /* Remote stylesheets enabled? */ |