------------------------------------------------------------------------------
| 948 | |
| 949 | //------------------------------------------------------------------------------ |
| 950 | void vtkPDFContextDevice2D::DrawQuad(float* p, int n) |
| 951 | { |
| 952 | assert(n > 0); |
| 953 | assert(p != nullptr); |
| 954 | |
| 955 | if (this->Brush->GetColorObject().GetAlpha() == 0 && this->Brush->GetTexture() == nullptr) |
| 956 | { |
| 957 | return; |
| 958 | } |
| 959 | |
| 960 | this->PushGraphicsState(); |
| 961 | this->ApplyBrushState(); |
| 962 | this->RegisterTexturePoints(p, n); |
| 963 | |
| 964 | size_t numQuads = n / 4; |
| 965 | for (size_t quad = 0; quad < numQuads; ++quad) |
| 966 | { |
| 967 | const size_t i = quad * 8; // (4 verts / quad) * (2 floats / vert) |
| 968 | |
| 969 | HPDF_Page_MoveTo(this->Impl->Page, p[i], p[i + 1]); |
| 970 | HPDF_Page_LineTo(this->Impl->Page, p[i + 2], p[i + 3]); |
| 971 | HPDF_Page_LineTo(this->Impl->Page, p[i + 4], p[i + 5]); |
| 972 | HPDF_Page_LineTo(this->Impl->Page, p[i + 6], p[i + 7]); |
| 973 | HPDF_Page_ClosePath(this->Impl->Page); |
| 974 | } |
| 975 | |
| 976 | this->Fill(); |
| 977 | this->PopGraphicsState(); |
| 978 | } |
| 979 | |
| 980 | //------------------------------------------------------------------------------ |
| 981 | void vtkPDFContextDevice2D::DrawQuadStrip(float* p, int n) |