OLD | NEW |
1 Name | 1 Name |
2 | 2 |
3 CHROMIUM_path_rendering | 3 CHROMIUM_path_rendering |
4 | 4 |
5 Name Strings | 5 Name Strings |
6 | 6 |
7 GL_CHROMIUM_path_rendering | 7 GL_CHROMIUM_path_rendering |
8 | 8 |
9 Version | 9 Version |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 PATH_MITER_LIMIT_CHROMIUM 0x907a | 47 PATH_MITER_LIMIT_CHROMIUM 0x907a |
48 PATH_STROKE_BOUND_CHROMIUM 0x9086 | 48 PATH_STROKE_BOUND_CHROMIUM 0x9086 |
49 | 49 |
50 Accepted by the <value> parameter of PathParameter{if}CHROMIUM: | 50 Accepted by the <value> parameter of PathParameter{if}CHROMIUM: |
51 FLAT_CHROMIUM 0x1D00 | 51 FLAT_CHROMIUM 0x1D00 |
52 SQUARE_CHROMIUM 0x90a3 | 52 SQUARE_CHROMIUM 0x90a3 |
53 ROUND_CHROMIUM 0x90a4 | 53 ROUND_CHROMIUM 0x90a4 |
54 BEVEL_CHROMIUM 0x90A6 | 54 BEVEL_CHROMIUM 0x90A6 |
55 MITER_REVERT_CHROMIUM 0x90A7 | 55 MITER_REVERT_CHROMIUM 0x90A7 |
56 | 56 |
57 Accepted by the <fillMode> parameter of StencilFillPathCHROMIUM: | 57 Accepted by the <fillMode> parameter of StencilFillPathCHROMIUM |
| 58 StencilFillPathInstancedCHROMIUM and |
| 59 StencilThenCoverFillPathInstancedCHROMIUM: |
58 COUNT_UP_CHROMIUM 0x9088 | 60 COUNT_UP_CHROMIUM 0x9088 |
59 COUNT_DOWN_CHROMIUM 0x9089 | 61 COUNT_DOWN_CHROMIUM 0x9089 |
60 | 62 |
61 Accepted by the <coverMode> parameter of CoverFillPathCHROMIUM, | 63 Accepted by the <coverMode> parameter of CoverFillPathCHROMIUM, |
62 CoverStrokePath, StencilThenCoverFillPathCHROMIUM and | 64 CoverStrokePath, StencilThenCoverFillPathCHROMIUM and |
63 StencilThenCoverStrokePathCHROMIUM: | 65 StencilThenCoverStrokePathCHROMIUM: |
64 CONVEX_HULL_CHROMIUM 0x908B | 66 CONVEX_HULL_CHROMIUM 0x908B |
65 BOUNDING_BOX_CHROMIUM 0x908D | 67 BOUNDING_BOX_CHROMIUM 0x908D |
66 | 68 |
| 69 Accepted by the <coverMode> parameter of CoverFillPathInstancedCHROMIUM, |
| 70 CoverStrokePathInstanced, StencilThenCoverFillPathInstancedCHROMIUM and |
| 71 StencilThenCoverStrokePathInstancedCHROMIUM: |
| 72 CONVEX_HULL_CHROMIUM see above |
| 73 BOUNDING_BOX_CHROMIUM see above |
| 74 BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM 0x909C |
| 75 |
| 76 Accepted by the <transformType> parameter of |
| 77 StencilFillPathInstancedCHROMIUM, StencilStrokePathInstancedCHROMIUM, |
| 78 CoverFillPathInstancedCHROMIUM, CoverStrokePathInstancedCHROMIUM, |
| 79 StencilThenCoverFillPathInstancedCHROMIUM and |
| 80 StencilThenCoverStrokePathInstancedCHROMIUM: |
| 81 TRANSLATE_X_CHROMIUM 0x908E |
| 82 TRANSLATE_Y_CHROMIUM 0x908F |
| 83 TRANSLATE_2D_CHROMIUM 0x9090 |
| 84 TRANSLATE_3D_CHROMIUM 0x9091 |
| 85 AFFINE_2D_CHROMIUM 0x9092 |
| 86 AFFINE_3D_CHROMIUM 0x9094 |
| 87 TRANSPOSE_AFFINE_2D_CHROMIUM 0x9096 |
| 88 TRANSPOSE_AFFINE_3D_CHROMIUM 0x9098 |
67 | 89 |
68 New Procedures and Functions | 90 New Procedures and Functions |
69 | 91 |
70 void MatrixLoadfCHROMIUM(enum matrixMode, float* matrix) | 92 void MatrixLoadfCHROMIUM(enum matrixMode, float* matrix) |
71 | 93 |
72 Takes a pointer to a 4x4 matrix stored in column-major order as 16 | 94 Takes a pointer to a 4x4 matrix stored in column-major order as 16 |
73 consecutive floating-point values. The matrixMode specifies which | 95 consecutive floating-point values. The matrixMode specifies which |
74 matrix, PATH_MODELVIEW_CHROMIUM or PATH_PROJECTION_CHROMIUM is used. | 96 matrix, PATH_MODELVIEW_CHROMIUM or PATH_PROJECTION_CHROMIUM is used. |
75 | 97 |
76 The funcition specifies either modelview or projection matrix | 98 The funcition specifies either modelview or projection matrix |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 * Any sample that would fail the scissor test (section 4.1.2) | 301 * Any sample that would fail the scissor test (section 4.1.2) |
280 if SCISSOR_TEST is enabled. | 302 if SCISSOR_TEST is enabled. |
281 | 303 |
282 And for the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM commands | 304 And for the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM commands |
283 (so not applicable to the CoverFillPathCHROMIUM and CoverStrokePathCHROMIUM | 305 (so not applicable to the CoverFillPathCHROMIUM and CoverStrokePathCHROMIUM |
284 commands): | 306 commands): |
285 * Any sample that would fail the (implicitly enabled) stencil test | 307 * Any sample that would fail the (implicitly enabled) stencil test |
286 with the stencil function configured based on the path stencil | 308 with the stencil function configured based on the path stencil |
287 function state configured by PathStencilFuncCHROMIUM. In the case | 309 function state configured by PathStencilFuncCHROMIUM. In the case |
288 of the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM | 310 of the StencilFillPathCHROMIUM and StencilStrokePathCHROMIUM |
289 commands, the effective stencil read | 311 commands and their instanced versions, the effective stencil read |
290 mask for the stencil mask is treated as the value of | 312 mask for the stencil mask is treated as the value of |
291 PATH_STENCIL_VALUE_MASK bit-wise ANDed with the bit-invert of the | 313 PATH_STENCIL_VALUE_MASK bit-wise ANDed with the bit-invert of the |
292 effective /mask/ parameter value; otherwise, for the cover commands, | 314 effective /mask/ parameter value; otherwise, for the cover commands, |
293 the stencil test operates normally. In the case the stencil test | 315 the stencil test operates normally. In the case the stencil test |
294 fails during a path stencil operation, the stencil fail operation is | 316 fails during a path stencil operation, the stencil fail operation is |
295 ignored and the pixel's stencil value is left undisturbed (as if the | 317 ignored and the pixel's stencil value is left undisturbed (as if the |
296 stencil operation was KEEP). | 318 stencil operation was KEEP). |
297 | 319 |
298 * The state of the face culling (CULL_FACE) enable is ignored. | 320 * The state of the face culling (CULL_FACE) enable is ignored. |
299 | 321 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 void StencilThenCoverStrokePathCHROMIUM(uint path, int reference, uint mask,
enum coverMode) | 497 void StencilThenCoverStrokePathCHROMIUM(uint path, int reference, uint mask,
enum coverMode) |
476 | 498 |
477 The command is equivalent to the two commands | 499 The command is equivalent to the two commands |
478 | 500 |
479 StencilStrokePathCHROMIUM(path, reference, mask); | 501 StencilStrokePathCHROMIUM(path, reference, mask); |
480 CoverStrokePathCHROMIUM(path, coverMode); | 502 CoverStrokePathCHROMIUM(path, coverMode); |
481 | 503 |
482 unless either command would generate an error; for any such error | 504 unless either command would generate an error; for any such error |
483 other than OUT_OF_MEMORY, only that error is generated. | 505 other than OUT_OF_MEMORY, only that error is generated. |
484 | 506 |
| 507 void StencilFillPathInstancedCHROMIUM(sizei numPaths, |
| 508 enum pathNameType, |
| 509 const void *paths, |
| 510 uint pathBase, |
| 511 enum fillMode, uint mask, |
| 512 enum transformType, |
| 513 const float *transformValues); |
| 514 |
| 515 The command stencils a sequence of filled paths. |
| 516 |
| 517 The /numPaths/ has to be >= 0. Otherwise INVALID_VALUE error is |
| 518 generated. |
| 519 |
| 520 The /numPaths/ has to fit in 32-bit uint. Otherwise |
| 521 INVALID_OPERATION is generated. |
| 522 |
| 523 The /pathNameType/ determines the type of elements of the /paths/ |
| 524 array and must be one of UNSIGNED_BYTE, BYTE, UNSIGNED_SHORT, SHORT, |
| 525 UNSIGNED_INT or INT. Otherwise INVALID_ENUM error is generated. |
| 526 |
| 527 The /pathBase/ is an offset added to the /numPaths/ path names read |
| 528 from the /paths/ array. Each result is 2's complement integer and it |
| 529 is cast to uint path name.. |
| 530 |
| 531 The /transformType/ must be one of NONE, TRANSLATE_X_CHROMIUM, |
| 532 TRANSLATE_Y_CHROMIUM, TRANSLATE_2D_CHROMIUM, TRANSLATE_3D_CHROMIUM, |
| 533 AFFINE_2D_CHROMIUM, AFFINE_3D_CHROMIUM, TRANSPOSE_AFFINE_2D_CHROMIUM, or |
| 534 TRANSPOSE_AFFINE_3D_CHROMIUM. Otherwise INVALID_ENUM error is generated. |
| 535 |
| 536 The /fillMode/ and /mask/ are validated identically to the same-named |
| 537 parameters of StencilFillPathCHROMIUM. |
| 538 |
| 539 The /numPaths/ * (size of /pathNameType/ data type) + /numPaths/ * |
| 540 (size of float) * (component count of /transformType/) must fit to |
| 541 32-bit uint. Otherwise INVALID_OPERATION is generated. |
| 542 |
| 543 The StencilFillPathInstancedCHROMIUM command is equivalent to: |
| 544 |
| 545 float dm[16]; |
| 546 GetFloatv(PATH_MODELVIEW_MATRIX, dm); |
| 547 const float *v = transformValues; |
| 548 for (int i = 0; i<numPaths; i++) { |
| 549 if (!applyPathTransform(dm, transformType, &v)) { |
| 550 return; |
| 551 } |
| 552 uint pathName; |
| 553 if (!getPathName(pathNameType, &paths, pathBase, &pathName)) { |
| 554 return; |
| 555 } |
| 556 if (IsPathCHROMIUM(pathName)) { |
| 557 StencilFillPathCHROMIUM(pathName, fillMode, mask); |
| 558 } |
| 559 } |
| 560 glMatrixLoadfCHROMIUM(PATH_MODELVIEW_CHROMIUM, dm); |
| 561 |
| 562 assuming these helper functions for applyPathTransform and |
| 563 getPathName: |
| 564 |
| 565 bool applyPathTransform(const float dm[], enum transformType, const floa
t** v) |
| 566 { |
| 567 float m[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; |
| 568 |
| 569 switch (transformType) { |
| 570 case NONE: |
| 571 break; |
| 572 case TRANSLATE_X_CHROMIUM: |
| 573 m[12] = (*v)[0]; |
| 574 *v += 1; |
| 575 break; |
| 576 case TRANSLATE_Y_CHROMIUM: |
| 577 m[13] = (*v)[0]; |
| 578 *v += 1; |
| 579 break; |
| 580 case TRANSLATE_2D_CHROMIUM: |
| 581 m[12] = (*v)[0]; |
| 582 m[13] = (*v)[1]; |
| 583 *v += 2; |
| 584 break; |
| 585 case TRANSLATE_3D_CHROMIUM: |
| 586 m[12] = (*v)[0]; |
| 587 m[13] = (*v)[1]; |
| 588 m[14] = (*v)[2]; |
| 589 *v += 3; |
| 590 break; |
| 591 case AFFINE_2D_CHROMIUM: |
| 592 m[0] =(*v)[0]; m[4] =(*v)[2]; m[8] =0; m[12]=(*v)[4]; |
| 593 m[1] =(*v)[1]; m[5] =(*v)[3]; m[9] =0; m[13]=(*v)[5]; |
| 594 m[2] =0 ; m[6] =0; m[10]=1; m[14]=0; |
| 595 m[3] =0; m[7] =0; m[11]=0; m[15]=1; |
| 596 *v += 6; |
| 597 break; |
| 598 case TRANSPOSE_AFFINE_2D_CHROMIUM: |
| 599 m[0] =(*v)[0]; m[4] =(*v)[1]; m[8] =0; m[12]=(*v)[2]; |
| 600 m[1] =(*v)[3]; m[5] =(*v)[4]; m[9] =0; m[13]=(*v)[5]; |
| 601 m[2] =0; m[6] =0; m[10]=1; m[14]=0; |
| 602 m[3] =0; m[7] =0; m[11]=0; m[15]=1; |
| 603 *v += 6; |
| 604 break; |
| 605 case AFFINE_3D_CHROMIUM: |
| 606 m[0] =(*v)[0]; m[4] =(*v)[3]; m[8] =(*v)[6]; m[12]=(*v)[9]; |
| 607 m[1] =(*v)[1]; m[5] =(*v)[4]; m[9] =(*v)[7]; m[13]=(*v)[10]; |
| 608 m[2] =(*v)[2]; m[6] =(*v)[5]; m[10]=(*v)[8]; m[14]=(*v)[11]; |
| 609 m[3] =0; m[7] =0; m[11]=1; m[15]=0; |
| 610 *v += 12; |
| 611 break; |
| 612 case TRANSPOSE_AFFINE_3D_CHROMIUM: |
| 613 m[0] =(*v)[0]; m[4] =(*v)[1]; m[8] =(*v)[2]; m[12]=(*v)[3]; |
| 614 m[1] =(*v)[4]; m[5] =(*v)[5]; m[9] =(*v)[6]; m[13]=(*v)[7]; |
| 615 m[2] =(*v)[8]; m[6] =(*v)[9]; m[10]=(*v)[10]; m[14]=(*v)[11]; |
| 616 m[3] =0; m[7] =0; m[11]=1; m[15]=0; |
| 617 *v += 12; |
| 618 break; |
| 619 default: |
| 620 setError(INVALID_ENUM); |
| 621 return FALSE; |
| 622 } |
| 623 multiplyMatrix(dm, m, m); // Multiplies dm and m and stores result to
m. |
| 624 glMatrixLoadfCHROMIUM(PATH_MODELVIEW_CHROMIUM, m); |
| 625 return TRUE; |
| 626 } |
| 627 |
| 628 bool getPathName(enum pathNameType, const void** paths, |
| 629 uint pathBase, uint* pathName) |
| 630 { |
| 631 switch (pathNameType) { |
| 632 case BYTE: |
| 633 { |
| 634 const byte *p = (const byte*)*paths; |
| 635 *pathName = pathBase + p[0]; |
| 636 *paths = p+1; |
| 637 break; |
| 638 } |
| 639 case UNSIGNED_BYTE: |
| 640 { |
| 641 const ubyte *p = (const ubyte*)*paths; |
| 642 *pathName = pathBase + p[0]; |
| 643 *paths = p+1; |
| 644 break; |
| 645 } |
| 646 case SHORT: |
| 647 { |
| 648 const short *p = (const short*)*paths; |
| 649 *pathName = pathBase + p[0]; |
| 650 *paths = p+1; |
| 651 break; |
| 652 } |
| 653 case UNSIGNED_SHORT: |
| 654 { |
| 655 const ushort *p = (const ushort*)*paths; |
| 656 *pathName = pathBase + p[0]; |
| 657 *paths = p+1; |
| 658 break; |
| 659 } |
| 660 case INT: |
| 661 { |
| 662 const int *p = (const int*)*paths; |
| 663 *pathName = pathBase + p[0]; |
| 664 *paths = p+1; |
| 665 break; |
| 666 } |
| 667 case UNSIGNED_INT: |
| 668 { |
| 669 const uint *p = (const uint*)*paths; |
| 670 *pathName = pathBase + p[0]; |
| 671 *paths = p+1; |
| 672 break; |
| 673 } |
| 674 default: |
| 675 setError(INVALID_ENUM); |
| 676 return FALSE; |
| 677 } |
| 678 return TRUE; |
| 679 } |
| 680 |
| 681 |
| 682 void StencilStrokePathInstancedCHROMIUM(sizei numPaths, |
| 683 enum pathNameType, |
| 684 const void *paths, |
| 685 uint pathBase, |
| 686 int reference, uint mask, |
| 687 enum transformType, |
| 688 const float *transformValues); |
| 689 |
| 690 The command stencils a sequence of stroked paths. |
| 691 |
| 692 The command verifies /numPaths/, /pathNameType/ and |
| 693 /transformType/ similarly to StencilFillPathInstancedCHROMIUM. |
| 694 |
| 695 The command is equivalent to: |
| 696 |
| 697 float dm[16]; |
| 698 GetFloatv(PATH_MODELVIEW_MATRIX, dm); |
| 699 const float *v = transformValues; |
| 700 for (int i = 0; i<numPaths; i++) { |
| 701 if (!applyPathTransform(dm, transformType, &v)) { |
| 702 return; |
| 703 } |
| 704 uint pathName; |
| 705 if (!getPathName(pathNameType, &paths, pathBase, &pathName)) { |
| 706 return; |
| 707 } |
| 708 if (IsPathCHROMIUM(pathName)) { |
| 709 StencilStrokePathCHROMIUM(pathName, reference, mask); |
| 710 } |
| 711 } |
| 712 glMatrixLoadfCHROMIUM(PATH_MODELVIEW_CHROMIUM, dm); |
| 713 |
| 714 assume the helper functions for applyPathTransform and |
| 715 getPathName defined above. |
| 716 |
| 717 void CoverFillPathInstancedCHROMIUM(sizei numPaths, |
| 718 enum pathNameType, |
| 719 const void *paths, |
| 720 uint pathBase, |
| 721 enum coverMode, |
| 722 enum transformType, |
| 723 const float *transformValues); |
| 724 |
| 725 The command covers a sequence of filled paths. |
| 726 |
| 727 The command verifies /numPaths/, /pathNameType/ and |
| 728 /transformType/ similarly to StencilFillPathInstancedCHROMIUM. |
| 729 |
| 730 The command is equivalent to: |
| 731 |
| 732 if (coverMode == BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM) { |
| 733 renderBoundingBox(FALSE, |
| 734 numPaths, |
| 735 pathNameType, |
| 736 paths, |
| 737 pathBase, |
| 738 transformType, transformValues); |
| 739 } else if (coverMode == CONVEX_HULL_CHROMIUM || coverMode == BOUNDING_BO
X_CHROMIUM) { |
| 740 float dm[16]; |
| 741 GetFloatv(PATH_MODELVIEW_MATRIX, dm); |
| 742 const float *v = transformValues; |
| 743 for (int i = 0; i<numPaths; i++) { |
| 744 if (!applyPathTransform(dm, transformType, &v)) { |
| 745 return; |
| 746 } |
| 747 uint pathName; |
| 748 if (!getPathName(pathNameType, &paths, pathBase, &pathName)) { |
| 749 return; |
| 750 } |
| 751 if (IsPathCHROMIUM(pathName)) { |
| 752 CoverFillPathCHROMIUM(pathName, coverMode); |
| 753 } |
| 754 } |
| 755 glMatrixLoadfCHROMIUM(PATH_MODELVIEW_CHROMIUM, dm); |
| 756 } else { |
| 757 setError(INVALID_ENUM); |
| 758 } |
| 759 |
| 760 |
| 761 assuming these helper functions for applyPathTransform and |
| 762 getPathName defined above as well as: |
| 763 |
| 764 void renderBoundingBox(bool shouldRenderStroke, |
| 765 sizei numPaths, |
| 766 enum pathNameType, |
| 767 const uint *paths, |
| 768 uint pathBase, |
| 769 enum transformType, |
| 770 const float *transformValues) |
| 771 { |
| 772 boolean hasBounds = FALSE; |
| 773 float boundsUnion[4], bounds[4]; |
| 774 |
| 775 const float *v = transformValues; |
| 776 for (int i = 0; i<numPaths; i++) { |
| 777 uint pathName; |
| 778 if (!getPathName(pathNameType, paths, pathBase, &pathName)) { |
| 779 return; |
| 780 } |
| 781 if (IsPathCHROMIUM(pathName)) { |
| 782 GetPathBoundingBox(pathName, shouldRenderStroke, bounds); |
| 783 switch (transformType) { |
| 784 case NONE: |
| 785 break; |
| 786 case TRANSLATE_X_CHROMIUM: |
| 787 bounds[0] += v[0]; |
| 788 bounds[2] += v[0]; |
| 789 v += 1; |
| 790 break; |
| 791 case TRANSLATE_Y_CHROMIUM: |
| 792 bounds[1] += v[0]; |
| 793 bounds[3] += v[0]; |
| 794 v += 1; |
| 795 break; |
| 796 case TRANSLATE_2D_CHROMIUM: |
| 797 bounds[0] += v[0]; |
| 798 bounds[1] += v[1]; |
| 799 bounds[2] += v[0]; |
| 800 bounds[3] += v[1]; |
| 801 v += 2; |
| 802 break; |
| 803 case TRANSLATE_3D_CHROMIUM: // ignores v[2] |
| 804 bounds[0] += v[0]; |
| 805 bounds[1] += v[1]; |
| 806 bounds[2] += v[0]; |
| 807 bounds[3] += v[1]; |
| 808 v += 3; |
| 809 break; |
| 810 case AFFINE_2D_CHROMIUM: |
| 811 bounds[0] = bounds[0]*v[0] + bounds[0]*v[2] + v[4]; |
| 812 bounds[1] = bounds[1]*v[1] + bounds[1]*v[3] + v[5]; |
| 813 bounds[2] = bounds[2]*v[0] + bounds[2]*v[2] + v[4]; |
| 814 bounds[3] = bounds[3]*v[1] + bounds[3]*v[3] + v[5]; |
| 815 v += 6; |
| 816 break; |
| 817 case TRANSPOSE_AFFINE_2D_CHROMIUM: |
| 818 bounds[0] = bounds[0]*v[0] + bounds[0]*v[1] + v[2]; |
| 819 bounds[1] = bounds[1]*v[3] + bounds[1]*v[4] + v[5]; |
| 820 bounds[2] = bounds[2]*v[0] + bounds[2]*v[1] + v[2]; |
| 821 bounds[3] = bounds[3]*v[3] + bounds[3]*v[4] + v[5]; |
| 822 v += 6; |
| 823 break; |
| 824 case AFFINE_3D_CHROMIUM: // ignores v[2], v[5], v[6..8], v[11] |
| 825 bounds[0] = bounds[0]*v[0] + bounds[0]*v[3] + v[9]; |
| 826 bounds[1] = bounds[1]*v[1] + bounds[1]*v[4] + v[10]; |
| 827 bounds[2] = bounds[2]*v[0] + bounds[2]*v[3] + v[9]; |
| 828 bounds[3] = bounds[3]*v[1] + bounds[3]*v[4] + v[10]; |
| 829 v += 12; |
| 830 break; |
| 831 case TRANSPOSE_AFFINE_3D_CHROMIUM: // ignores v[2], v[6], v[8..11
] |
| 832 bounds[0] = bounds[0]*v[0] + bounds[0]*v[1] + v[3]; |
| 833 bounds[1] = bounds[1]*v[4] + bounds[1]*v[5] + v[7]; |
| 834 bounds[2] = bounds[2]*v[0] + bounds[2]*v[1] + v[3]; |
| 835 bounds[3] = bounds[3]*v[4] + bounds[3]*v[5] + v[7]; |
| 836 v += 12; |
| 837 break; |
| 838 default: |
| 839 setError(INVALID_ENUM); |
| 840 return; |
| 841 } |
| 842 if (bounds[0] > bounds[2]) { |
| 843 float t = bounds[2]; |
| 844 bounds[2] = bounds[0]; |
| 845 bounds[0] = t; |
| 846 } |
| 847 if (bounds[1] > bounds[3]) { |
| 848 float t = bounds[3]; |
| 849 bounds[3] = bounds[1]; |
| 850 bounds[1] = t; |
| 851 } |
| 852 if (hasBounds) { |
| 853 if (bounds[0] < boundsUnion[0]) { |
| 854 boundsUnion[0] = bounds[0]; |
| 855 } |
| 856 if (bounds[1] < boundsUnion[1]) { |
| 857 boundsUnion[1] = bounds[1]; |
| 858 } |
| 859 if (bounds[2] > boundsUnion[2]) { |
| 860 boundsUnion[2] = bounds[2]; |
| 861 } |
| 862 if (bounds[3] > boundsUnion[3]) { |
| 863 boundsUnion[3] = bounds[3]; |
| 864 } |
| 865 } else { |
| 866 for (int i=0; i<4; i++) { |
| 867 boundsUnion[i] = bounds[i]; |
| 868 } |
| 869 hasBounds = TRUE; |
| 870 } |
| 871 } |
| 872 } |
| 873 if (hasBounds) { |
| 874 Rectf(boundsUnion[0], boundsUnion[1], boundsUnion[2], boundsUnion[3
]); |
| 875 } |
| 876 } |
| 877 |
| 878 Where helper GetPathBoundingBox returns bounding box for the path with or wi
thout |
| 879 stroking, and Rectf renders a rectangle. |
| 880 |
| 881 /coverMode/ must be one of CONVEX_HULL_CHROMIUM or BOUNDING_BOX_CHROMIUM or |
| 882 BOUNDING_BOX_OF_BOUNDING_BOXES. Otherwise, INVALID_ENUM error is generated. |
| 883 |
| 884 void CoverStrokePathInstancedCHROMIUM(sizei numPaths, |
| 885 enum pathNameType, |
| 886 const void *paths, |
| 887 uint pathBase, |
| 888 enum coverMode, |
| 889 enum transformType, |
| 890 const float *transformValues); |
| 891 |
| 892 The command covers a sequence of stroked paths. |
| 893 |
| 894 The command verifies /numPaths/, /pathNameType/ and |
| 895 /transformType/ similarly to StencilFillPathInstancedCHROMIUM. |
| 896 |
| 897 The command is equivalent to: |
| 898 |
| 899 if (coverage == BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM) { |
| 900 renderBoundingBox(TRUE, |
| 901 numPaths, |
| 902 pathNameType, paths, |
| 903 pathBase, |
| 904 transformType, transformValues); |
| 905 } else if (coverMode == CONVEX_HULL_CHROMIUM || coverMode == BOUNDING_BO
X_CHROMIUM) { |
| 906 float dm[16]; |
| 907 GetFloatv(PATH_MODELVIEW_MATRIX, dm); |
| 908 const float *v = transformValues; |
| 909 for (int i = 0; i<numPaths; i++) { |
| 910 if (!applyPathTransform(dm, transformType, &v)) { |
| 911 return; |
| 912 } |
| 913 uint pathName; |
| 914 if (!getPathName(pathNameType, &paths, pathBase, &pathName)) { |
| 915 return; |
| 916 } |
| 917 if (IsPathCHROMIUM(pathName)) { |
| 918 CoverStrokePathCHROMIUM(pathName, coverMode); |
| 919 } |
| 920 } |
| 921 glMatrixLoadfCHROMIUM(PATH_MODELVIEW_CHROMIUM, dm); |
| 922 } else { |
| 923 setError(INVALID_ENUM); |
| 924 } |
| 925 |
| 926 assuming these helper functions defined above. |
| 927 |
| 928 /coverMode/ must be one of CONVEX_HULL_CHROMIUM or BOUNDING_BOX_CHROMIUM or |
| 929 BOUNDING_BOX_OF_BOUNDING_BOXES. Otherwise, INVALID_ENUM error is generated. |
| 930 |
| 931 |
| 932 void StencilThenCoverFillPathInstancedCHROMIUM(sizei numPaths, |
| 933 enum pathNameType, |
| 934 const void *paths, |
| 935 uint pathBase, |
| 936 enum coverMode, |
| 937 enum fillMode, |
| 938 uint mask, |
| 939 enum transformType, |
| 940 const float *transformValues)
; |
| 941 |
| 942 The command is equivalent to the two commands |
| 943 |
| 944 StencilFillPathInstancedCHROMIUM(numPaths |
| 945 paths, |
| 946 pathBase, |
| 947 fillMode, |
| 948 mask, |
| 949 transformType, |
| 950 transformValues); |
| 951 CoverFillPathInstancedCHROMIUM(numPaths, |
| 952 paths, |
| 953 pathBase, |
| 954 coverMode, |
| 955 fillMode, |
| 956 mask, |
| 957 transformType, |
| 958 transformValues); |
| 959 |
| 960 unless either command would generate an error; for any such error |
| 961 other than OUT_OF_MEMORY, only that error is generated. |
| 962 |
| 963 |
| 964 void StencilThenCoverStrokePathInstancedCHROMIUM(sizei numPaths, |
| 965 enum pathNameType, |
| 966 const void *paths, |
| 967 uint pathBase, |
| 968 enum coverMode, |
| 969 int reference, |
| 970 uint mask, |
| 971 enum transformType, |
| 972 const float *transformValue
s); |
| 973 |
| 974 The command is equivalent to the two commands |
| 975 |
| 976 StencilStrokePathInstancedCHROMIUM(numPaths, |
| 977 pathNameType, |
| 978 paths, |
| 979 pathBase, |
| 980 reference, |
| 981 mask, |
| 982 transformType, |
| 983 transformValues); |
| 984 CoverStrokePathInstancedCHROMIUM(numPaths, |
| 985 pathNameType, |
| 986 paths, |
| 987 pathBase, |
| 988 coverMode, |
| 989 transformType, |
| 990 transformValues); |
| 991 |
| 992 unless either command would generate an error; for any such error |
| 993 other than OUT_OF_MEMORY, only that error is generated. |
| 994 |
485 | 995 |
486 PATH COVERING RASTERIZATION DETAILS | 996 PATH COVERING RASTERIZATION DETAILS |
487 | 997 |
488 The GL processes fragments rasterized by path cover commands in | 998 The GL processes fragments rasterized by path cover commands in |
489 much the same manner as fragments generated by conventional polygon | 999 much the same manner as fragments generated by conventional polygon |
490 rasterization. However path rendering /ignores/ the following | 1000 rasterization. However path rendering /ignores/ the following |
491 operations: | 1001 operations: |
492 | 1002 |
493 * Interpolation of per-vertex data (section 3.6.1). Path | 1003 * Interpolation of per-vertex data (section 3.6.1). Path |
494 primitives have neither conventional vertices nor per-vertex | 1004 primitives have neither conventional vertices nor per-vertex |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 * Paths wind by default counterclockwise | 1134 * Paths wind by default counterclockwise |
625 * Window space transform can reverse this winding | 1135 * Window space transform can reverse this winding |
626 * GL front face state CW/CCW selects whether the variable is true | 1136 * GL front face state CW/CCW selects whether the variable is true |
627 or false | 1137 or false |
628 | 1138 |
629 user-defined varyings: constant zeros. | 1139 user-defined varyings: constant zeros. |
630 | 1140 |
631 Revision History | 1141 Revision History |
632 | 1142 |
633 14/8/2014 Documented the extension | 1143 14/8/2014 Documented the extension |
OLD | NEW |