The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

792 lines
21KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. const int juce_edgeTableDefaultEdgesPerLine = 32;
  18. //==============================================================================
  19. EdgeTable::EdgeTable (const Rectangle<int>& area,
  20. const Path& path, const AffineTransform& transform)
  21. : bounds (area),
  22. maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine),
  23. lineStrideElements (juce_edgeTableDefaultEdgesPerLine * 2 + 1),
  24. needToCheckEmptinesss (true)
  25. {
  26. table.malloc ((size_t) ((bounds.getHeight() + 1) * lineStrideElements));
  27. int* t = table;
  28. for (int i = bounds.getHeight(); --i >= 0;)
  29. {
  30. *t = 0;
  31. t += lineStrideElements;
  32. }
  33. const int leftLimit = bounds.getX() << 8;
  34. const int topLimit = bounds.getY() << 8;
  35. const int rightLimit = bounds.getRight() << 8;
  36. const int heightLimit = bounds.getHeight() << 8;
  37. PathFlatteningIterator iter (path, transform);
  38. while (iter.next())
  39. {
  40. int y1 = roundToInt (iter.y1 * 256.0f);
  41. int y2 = roundToInt (iter.y2 * 256.0f);
  42. if (y1 != y2)
  43. {
  44. y1 -= topLimit;
  45. y2 -= topLimit;
  46. const int startY = y1;
  47. int direction = -1;
  48. if (y1 > y2)
  49. {
  50. std::swap (y1, y2);
  51. direction = 1;
  52. }
  53. if (y1 < 0)
  54. y1 = 0;
  55. if (y2 > heightLimit)
  56. y2 = heightLimit;
  57. if (y1 < y2)
  58. {
  59. const double startX = 256.0f * iter.x1;
  60. const double multiplier = (iter.x2 - iter.x1) / (iter.y2 - iter.y1);
  61. const int stepSize = jlimit (1, 256, 256 / (1 + (int) std::abs (multiplier)));
  62. do
  63. {
  64. const int step = jmin (stepSize, y2 - y1, 256 - (y1 & 255));
  65. int x = roundToInt (startX + multiplier * ((y1 + (step >> 1)) - startY));
  66. if (x < leftLimit)
  67. x = leftLimit;
  68. else if (x >= rightLimit)
  69. x = rightLimit - 1;
  70. addEdgePoint (x, y1 >> 8, direction * step);
  71. y1 += step;
  72. }
  73. while (y1 < y2);
  74. }
  75. }
  76. }
  77. sanitiseLevels (path.isUsingNonZeroWinding());
  78. }
  79. EdgeTable::EdgeTable (const Rectangle<int>& rectangleToAdd)
  80. : bounds (rectangleToAdd),
  81. maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine),
  82. lineStrideElements (juce_edgeTableDefaultEdgesPerLine * 2 + 1),
  83. needToCheckEmptinesss (true)
  84. {
  85. allocate();
  86. table[0] = 0;
  87. const int x1 = rectangleToAdd.getX() << 8;
  88. const int x2 = rectangleToAdd.getRight() << 8;
  89. int* t = table;
  90. for (int i = rectangleToAdd.getHeight(); --i >= 0;)
  91. {
  92. t[0] = 2;
  93. t[1] = x1;
  94. t[2] = 255;
  95. t[3] = x2;
  96. t[4] = 0;
  97. t += lineStrideElements;
  98. }
  99. }
  100. EdgeTable::EdgeTable (const RectangleList<int>& rectanglesToAdd)
  101. : bounds (rectanglesToAdd.getBounds()),
  102. maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine),
  103. lineStrideElements (juce_edgeTableDefaultEdgesPerLine * 2 + 1),
  104. needToCheckEmptinesss (true)
  105. {
  106. allocate();
  107. clearLineSizes();
  108. for (const Rectangle<int>* r = rectanglesToAdd.begin(), * const e = rectanglesToAdd.end(); r != e; ++r)
  109. {
  110. const int x1 = r->getX() << 8;
  111. const int x2 = r->getRight() << 8;
  112. int y = r->getY() - bounds.getY();
  113. for (int j = r->getHeight(); --j >= 0;)
  114. addEdgePointPair (x1, x2, y++, 255);
  115. }
  116. sanitiseLevels (true);
  117. }
  118. EdgeTable::EdgeTable (const RectangleList<float>& rectanglesToAdd)
  119. : bounds (rectanglesToAdd.getBounds().getSmallestIntegerContainer()),
  120. maxEdgesPerLine (rectanglesToAdd.getNumRectangles() * 2),
  121. lineStrideElements (rectanglesToAdd.getNumRectangles() * 4 + 1),
  122. needToCheckEmptinesss (true)
  123. {
  124. bounds.setHeight (bounds.getHeight() + 1);
  125. allocate();
  126. clearLineSizes();
  127. for (const Rectangle<float>* r = rectanglesToAdd.begin(), * const e = rectanglesToAdd.end(); r != e; ++r)
  128. {
  129. const int x1 = roundToInt (r->getX() * 256.0f);
  130. const int x2 = roundToInt (r->getRight() * 256.0f);
  131. const int y1 = roundToInt (r->getY() * 256.0f) - (bounds.getY() << 8);
  132. const int y2 = roundToInt (r->getBottom() * 256.0f) - (bounds.getY() << 8);
  133. if (x2 <= x1 || y2 <= y1)
  134. continue;
  135. int y = y1 >> 8;
  136. const int lastLine = y2 >> 8;
  137. if (y == lastLine)
  138. {
  139. addEdgePointPair (x1, x2, y, y2 - y1);
  140. }
  141. else
  142. {
  143. addEdgePointPair (x1, x2, y++, 255 - (y1 & 255));
  144. while (y < lastLine)
  145. addEdgePointPair (x1, x2, y++, 255);
  146. jassert (y < bounds.getHeight());
  147. addEdgePointPair (x1, x2, y, y2 & 255);
  148. }
  149. }
  150. sanitiseLevels (true);
  151. }
  152. EdgeTable::EdgeTable (const Rectangle<float>& rectangleToAdd)
  153. : bounds (Rectangle<int> ((int) std::floor (rectangleToAdd.getX()),
  154. roundToInt (rectangleToAdd.getY() * 256.0f) >> 8,
  155. 2 + (int) rectangleToAdd.getWidth(),
  156. 2 + (int) rectangleToAdd.getHeight())),
  157. maxEdgesPerLine (juce_edgeTableDefaultEdgesPerLine),
  158. lineStrideElements ((juce_edgeTableDefaultEdgesPerLine << 1) + 1),
  159. needToCheckEmptinesss (true)
  160. {
  161. jassert (! rectangleToAdd.isEmpty());
  162. allocate();
  163. table[0] = 0;
  164. const int x1 = roundToInt (rectangleToAdd.getX() * 256.0f);
  165. const int x2 = roundToInt (rectangleToAdd.getRight() * 256.0f);
  166. int y1 = roundToInt (rectangleToAdd.getY() * 256.0f) - (bounds.getY() << 8);
  167. jassert (y1 < 256);
  168. int y2 = roundToInt (rectangleToAdd.getBottom() * 256.0f) - (bounds.getY() << 8);
  169. if (x2 <= x1 || y2 <= y1)
  170. {
  171. bounds.setHeight (0);
  172. return;
  173. }
  174. int lineY = 0;
  175. int* t = table;
  176. if ((y1 >> 8) == (y2 >> 8))
  177. {
  178. t[0] = 2;
  179. t[1] = x1;
  180. t[2] = y2 - y1;
  181. t[3] = x2;
  182. t[4] = 0;
  183. ++lineY;
  184. t += lineStrideElements;
  185. }
  186. else
  187. {
  188. t[0] = 2;
  189. t[1] = x1;
  190. t[2] = 255 - (y1 & 255);
  191. t[3] = x2;
  192. t[4] = 0;
  193. ++lineY;
  194. t += lineStrideElements;
  195. while (lineY < (y2 >> 8))
  196. {
  197. t[0] = 2;
  198. t[1] = x1;
  199. t[2] = 255;
  200. t[3] = x2;
  201. t[4] = 0;
  202. ++lineY;
  203. t += lineStrideElements;
  204. }
  205. jassert (lineY < bounds.getHeight());
  206. t[0] = 2;
  207. t[1] = x1;
  208. t[2] = y2 & 255;
  209. t[3] = x2;
  210. t[4] = 0;
  211. ++lineY;
  212. t += lineStrideElements;
  213. }
  214. while (lineY < bounds.getHeight())
  215. {
  216. t[0] = 0;
  217. t += lineStrideElements;
  218. ++lineY;
  219. }
  220. }
  221. EdgeTable::EdgeTable (const EdgeTable& other)
  222. {
  223. operator= (other);
  224. }
  225. EdgeTable& EdgeTable::operator= (const EdgeTable& other)
  226. {
  227. bounds = other.bounds;
  228. maxEdgesPerLine = other.maxEdgesPerLine;
  229. lineStrideElements = other.lineStrideElements;
  230. needToCheckEmptinesss = other.needToCheckEmptinesss;
  231. allocate();
  232. copyEdgeTableData (table, lineStrideElements, other.table, lineStrideElements, bounds.getHeight());
  233. return *this;
  234. }
  235. EdgeTable::~EdgeTable()
  236. {
  237. }
  238. //==============================================================================
  239. void EdgeTable::allocate()
  240. {
  241. table.malloc ((size_t) (jmax (1, bounds.getHeight()) * lineStrideElements));
  242. }
  243. void EdgeTable::clearLineSizes() noexcept
  244. {
  245. int* t = table;
  246. for (int i = bounds.getHeight(); --i >= 0;)
  247. {
  248. *t = 0;
  249. t += lineStrideElements;
  250. }
  251. }
  252. void EdgeTable::copyEdgeTableData (int* dest, const int destLineStride, const int* src, const int srcLineStride, int numLines) noexcept
  253. {
  254. while (--numLines >= 0)
  255. {
  256. memcpy (dest, src, (size_t) (src[0] * 2 + 1) * sizeof (int));
  257. src += srcLineStride;
  258. dest += destLineStride;
  259. }
  260. }
  261. void EdgeTable::sanitiseLevels (const bool useNonZeroWinding) noexcept
  262. {
  263. // Convert the table from relative windings to absolute levels..
  264. int* lineStart = table;
  265. for (int y = bounds.getHeight(); --y >= 0;)
  266. {
  267. int num = lineStart[0];
  268. if (num > 0)
  269. {
  270. LineItem* items = reinterpret_cast<LineItem*> (lineStart + 1);
  271. // sort the X coords
  272. std::sort (items, items + num);
  273. // merge duplicate X coords
  274. for (int i = 0; i < num - 1; ++i)
  275. {
  276. if (items[i].x == items[i + 1].x)
  277. {
  278. items[i].level += items[i + 1].level;
  279. memmove (items + i + 1, items + i + 2, (size_t) (num - i - 2) * sizeof (LineItem));
  280. --num;
  281. --lineStart[0];
  282. --i;
  283. }
  284. }
  285. int level = 0;
  286. if (useNonZeroWinding)
  287. {
  288. while (--num > 0)
  289. {
  290. level += items->level;
  291. int corrected = std::abs (level);
  292. if (corrected >> 8)
  293. corrected = 255;
  294. items->level = corrected;
  295. ++items;
  296. }
  297. }
  298. else
  299. {
  300. while (--num > 0)
  301. {
  302. level += items->level;
  303. int corrected = std::abs (level);
  304. if (corrected >> 8)
  305. {
  306. corrected &= 511;
  307. if (corrected >> 8)
  308. corrected = 511 - corrected;
  309. }
  310. items->level = corrected;
  311. ++items;
  312. }
  313. }
  314. items->level = 0; // force the last level to 0, just in case something went wrong in creating the table
  315. }
  316. lineStart += lineStrideElements;
  317. }
  318. }
  319. void EdgeTable::remapTableForNumEdges (const int newNumEdgesPerLine)
  320. {
  321. if (newNumEdgesPerLine != maxEdgesPerLine)
  322. {
  323. maxEdgesPerLine = newNumEdgesPerLine;
  324. jassert (bounds.getHeight() > 0);
  325. const int newLineStrideElements = maxEdgesPerLine * 2 + 1;
  326. HeapBlock <int> newTable ((size_t) (bounds.getHeight() * newLineStrideElements));
  327. copyEdgeTableData (newTable, newLineStrideElements, table, lineStrideElements, bounds.getHeight());
  328. table.swapWith (newTable);
  329. lineStrideElements = newLineStrideElements;
  330. }
  331. }
  332. void EdgeTable::optimiseTable()
  333. {
  334. int maxLineElements = 0;
  335. for (int i = bounds.getHeight(); --i >= 0;)
  336. maxLineElements = jmax (maxLineElements, table [i * lineStrideElements]);
  337. remapTableForNumEdges (maxLineElements);
  338. }
  339. void EdgeTable::addEdgePoint (const int x, const int y, const int winding)
  340. {
  341. jassert (y >= 0 && y < bounds.getHeight());
  342. int* line = table + lineStrideElements * y;
  343. const int numPoints = line[0];
  344. if (numPoints >= maxEdgesPerLine)
  345. {
  346. remapTableForNumEdges (maxEdgesPerLine + juce_edgeTableDefaultEdgesPerLine);
  347. jassert (numPoints < maxEdgesPerLine);
  348. line = table + lineStrideElements * y;
  349. }
  350. line[0]++;
  351. int n = numPoints << 1;
  352. line [n + 1] = x;
  353. line [n + 2] = winding;
  354. }
  355. void EdgeTable::addEdgePointPair (int x1, int x2, int y, int winding)
  356. {
  357. jassert (y >= 0 && y < bounds.getHeight());
  358. int* line = table + lineStrideElements * y;
  359. const int numPoints = line[0];
  360. if (numPoints + 1 >= maxEdgesPerLine)
  361. {
  362. remapTableForNumEdges (maxEdgesPerLine + juce_edgeTableDefaultEdgesPerLine);
  363. jassert (numPoints < maxEdgesPerLine);
  364. line = table + lineStrideElements * y;
  365. }
  366. line[0] += 2;
  367. int n = numPoints << 1;
  368. line [n + 1] = x1;
  369. line [n + 2] = winding;
  370. line [n + 3] = x2;
  371. line [n + 4] = -winding;
  372. }
  373. void EdgeTable::translate (float dx, const int dy) noexcept
  374. {
  375. bounds.translate ((int) std::floor (dx), dy);
  376. int* lineStart = table;
  377. const int intDx = (int) (dx * 256.0f);
  378. for (int i = bounds.getHeight(); --i >= 0;)
  379. {
  380. int* line = lineStart;
  381. lineStart += lineStrideElements;
  382. int num = *line++;
  383. while (--num >= 0)
  384. {
  385. *line += intDx;
  386. line += 2;
  387. }
  388. }
  389. }
  390. void EdgeTable::intersectWithEdgeTableLine (const int y, const int* otherLine)
  391. {
  392. jassert (y >= 0 && y < bounds.getHeight());
  393. int* dest = table + lineStrideElements * y;
  394. if (dest[0] == 0)
  395. return;
  396. const int otherNumPoints = *otherLine;
  397. if (otherNumPoints == 0)
  398. {
  399. *dest = 0;
  400. return;
  401. }
  402. const int right = bounds.getRight() << 8;
  403. // optimise for the common case where our line lies entirely within a
  404. // single pair of points, as happens when clipping to a simple rect.
  405. if (otherNumPoints == 2 && otherLine[2] >= 255)
  406. {
  407. clipEdgeTableLineToRange (dest, otherLine[1], jmin (right, otherLine[3]));
  408. return;
  409. }
  410. ++otherLine;
  411. const size_t lineSizeBytes = (size_t) (dest[0] * 2 + 1) * sizeof (int);
  412. int* temp = static_cast<int*> (alloca (lineSizeBytes));
  413. memcpy (temp, dest, lineSizeBytes);
  414. const int* src1 = temp;
  415. int srcNum1 = *src1++;
  416. int x1 = *src1++;
  417. const int* src2 = otherLine;
  418. int srcNum2 = otherNumPoints;
  419. int x2 = *src2++;
  420. int destIndex = 0, destTotal = 0;
  421. int level1 = 0, level2 = 0;
  422. int lastX = std::numeric_limits<int>::min(), lastLevel = 0;
  423. while (srcNum1 > 0 && srcNum2 > 0)
  424. {
  425. int nextX;
  426. if (x1 < x2)
  427. {
  428. nextX = x1;
  429. level1 = *src1++;
  430. x1 = *src1++;
  431. --srcNum1;
  432. }
  433. else if (x1 == x2)
  434. {
  435. nextX = x1;
  436. level1 = *src1++;
  437. level2 = *src2++;
  438. x1 = *src1++;
  439. x2 = *src2++;
  440. --srcNum1;
  441. --srcNum2;
  442. }
  443. else
  444. {
  445. nextX = x2;
  446. level2 = *src2++;
  447. x2 = *src2++;
  448. --srcNum2;
  449. }
  450. if (nextX > lastX)
  451. {
  452. if (nextX >= right)
  453. break;
  454. lastX = nextX;
  455. const int nextLevel = (level1 * (level2 + 1)) >> 8;
  456. jassert (isPositiveAndBelow (nextLevel, (int) 256));
  457. if (nextLevel != lastLevel)
  458. {
  459. if (destTotal >= maxEdgesPerLine)
  460. {
  461. dest[0] = destTotal;
  462. remapTableForNumEdges (jmax (256, destTotal * 2));
  463. dest = table + lineStrideElements * y;
  464. }
  465. ++destTotal;
  466. lastLevel = nextLevel;
  467. dest[++destIndex] = nextX;
  468. dest[++destIndex] = nextLevel;
  469. }
  470. }
  471. }
  472. if (lastLevel > 0)
  473. {
  474. if (destTotal >= maxEdgesPerLine)
  475. {
  476. dest[0] = destTotal;
  477. remapTableForNumEdges (jmax (256, destTotal * 2));
  478. dest = table + lineStrideElements * y;
  479. }
  480. ++destTotal;
  481. dest[++destIndex] = right;
  482. dest[++destIndex] = 0;
  483. }
  484. dest[0] = destTotal;
  485. }
  486. void EdgeTable::clipEdgeTableLineToRange (int* dest, const int x1, const int x2) noexcept
  487. {
  488. int* lastItem = dest + (dest[0] * 2 - 1);
  489. if (x2 < lastItem[0])
  490. {
  491. if (x2 <= dest[1])
  492. {
  493. dest[0] = 0;
  494. return;
  495. }
  496. while (x2 < lastItem[-2])
  497. {
  498. --(dest[0]);
  499. lastItem -= 2;
  500. }
  501. lastItem[0] = x2;
  502. lastItem[1] = 0;
  503. }
  504. if (x1 > dest[1])
  505. {
  506. while (lastItem[0] > x1)
  507. lastItem -= 2;
  508. const int itemsRemoved = (int) (lastItem - (dest + 1)) / 2;
  509. if (itemsRemoved > 0)
  510. {
  511. dest[0] -= itemsRemoved;
  512. memmove (dest + 1, lastItem, (size_t) dest[0] * (sizeof (int) * 2));
  513. }
  514. dest[1] = x1;
  515. }
  516. }
  517. //==============================================================================
  518. void EdgeTable::clipToRectangle (const Rectangle<int>& r)
  519. {
  520. const Rectangle<int> clipped (r.getIntersection (bounds));
  521. if (clipped.isEmpty())
  522. {
  523. needToCheckEmptinesss = false;
  524. bounds.setHeight (0);
  525. }
  526. else
  527. {
  528. const int top = clipped.getY() - bounds.getY();
  529. const int bottom = clipped.getBottom() - bounds.getY();
  530. if (bottom < bounds.getHeight())
  531. bounds.setHeight (bottom);
  532. for (int i = top; --i >= 0;)
  533. table [lineStrideElements * i] = 0;
  534. if (clipped.getX() > bounds.getX() || clipped.getRight() < bounds.getRight())
  535. {
  536. const int x1 = clipped.getX() << 8;
  537. const int x2 = jmin (bounds.getRight(), clipped.getRight()) << 8;
  538. int* line = table + lineStrideElements * top;
  539. for (int i = bottom - top; --i >= 0;)
  540. {
  541. if (line[0] != 0)
  542. clipEdgeTableLineToRange (line, x1, x2);
  543. line += lineStrideElements;
  544. }
  545. }
  546. needToCheckEmptinesss = true;
  547. }
  548. }
  549. void EdgeTable::excludeRectangle (const Rectangle<int>& r)
  550. {
  551. const Rectangle<int> clipped (r.getIntersection (bounds));
  552. if (! clipped.isEmpty())
  553. {
  554. const int top = clipped.getY() - bounds.getY();
  555. const int bottom = clipped.getBottom() - bounds.getY();
  556. const int rectLine[] = { 4, std::numeric_limits<int>::min(), 255,
  557. clipped.getX() << 8, 0,
  558. clipped.getRight() << 8, 255,
  559. std::numeric_limits<int>::max(), 0 };
  560. for (int i = top; i < bottom; ++i)
  561. intersectWithEdgeTableLine (i, rectLine);
  562. needToCheckEmptinesss = true;
  563. }
  564. }
  565. void EdgeTable::clipToEdgeTable (const EdgeTable& other)
  566. {
  567. const Rectangle<int> clipped (other.bounds.getIntersection (bounds));
  568. if (clipped.isEmpty())
  569. {
  570. needToCheckEmptinesss = false;
  571. bounds.setHeight (0);
  572. }
  573. else
  574. {
  575. const int top = clipped.getY() - bounds.getY();
  576. const int bottom = clipped.getBottom() - bounds.getY();
  577. if (bottom < bounds.getHeight())
  578. bounds.setHeight (bottom);
  579. if (clipped.getRight() < bounds.getRight())
  580. bounds.setRight (clipped.getRight());
  581. for (int i = 0; i < top; ++i)
  582. table [lineStrideElements * i] = 0;
  583. const int* otherLine = other.table + other.lineStrideElements * (clipped.getY() - other.bounds.getY());
  584. for (int i = top; i < bottom; ++i)
  585. {
  586. intersectWithEdgeTableLine (i, otherLine);
  587. otherLine += other.lineStrideElements;
  588. }
  589. needToCheckEmptinesss = true;
  590. }
  591. }
  592. void EdgeTable::clipLineToMask (int x, int y, const uint8* mask, int maskStride, int numPixels)
  593. {
  594. y -= bounds.getY();
  595. if (y < 0 || y >= bounds.getHeight())
  596. return;
  597. needToCheckEmptinesss = true;
  598. if (numPixels <= 0)
  599. {
  600. table [lineStrideElements * y] = 0;
  601. return;
  602. }
  603. int* tempLine = static_cast<int*> (alloca ((size_t) (numPixels * 2 + 4) * sizeof (int)));
  604. int destIndex = 0, lastLevel = 0;
  605. while (--numPixels >= 0)
  606. {
  607. const int alpha = *mask;
  608. mask += maskStride;
  609. if (alpha != lastLevel)
  610. {
  611. tempLine[++destIndex] = (x << 8);
  612. tempLine[++destIndex] = alpha;
  613. lastLevel = alpha;
  614. }
  615. ++x;
  616. }
  617. if (lastLevel > 0)
  618. {
  619. tempLine[++destIndex] = (x << 8);
  620. tempLine[++destIndex] = 0;
  621. }
  622. tempLine[0] = destIndex >> 1;
  623. intersectWithEdgeTableLine (y, tempLine);
  624. }
  625. bool EdgeTable::isEmpty() noexcept
  626. {
  627. if (needToCheckEmptinesss)
  628. {
  629. needToCheckEmptinesss = false;
  630. int* t = table;
  631. for (int i = bounds.getHeight(); --i >= 0;)
  632. {
  633. if (t[0] > 1)
  634. return false;
  635. t += lineStrideElements;
  636. }
  637. bounds.setHeight (0);
  638. }
  639. return bounds.getHeight() == 0;
  640. }