[poppler] poppler/GfxState.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Feb 17 17:13:52 UTC 2020
poppler/GfxState.cc | 40 ++++------------------------------------
1 file changed, 4 insertions(+), 36 deletions(-)
New commits:
commit dcce8cc11dd29180bcadbd182d3a8e6900bc08f8
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Feb 17 01:08:30 2020 +0100
Remove dead code from GfxGouraudTriangleShading::getTriangle
If we're asserting for !isParameterized, that means nFuncs == 0
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index f52603be..47ae1e5c 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -4877,54 +4877,22 @@ void GfxGouraudTriangleShading::getTriangle(
double *x0, double *y0, GfxColor *color0,
double *x1, double *y1, GfxColor *color1,
double *x2, double *y2, GfxColor *color2) {
- double in;
- double out[gfxColorMaxComps];
- int v, j;
+ int v;
assert(!isParameterized());
v = triangles[i][0];
*x0 = vertices[v].x;
*y0 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color0->c[j] = dblToCol(out[j]);
- }
- } else {
- *color0 = vertices[v].color;
- }
+ *color0 = vertices[v].color;
v = triangles[i][1];
*x1 = vertices[v].x;
*y1 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color1->c[j] = dblToCol(out[j]);
- }
- } else {
- *color1 = vertices[v].color;
- }
+ *color1 = vertices[v].color;
v = triangles[i][2];
*x2 = vertices[v].x;
*y2 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color2->c[j] = dblToCol(out[j]);
- }
- } else {
- *color2 = vertices[v].color;
- }
+ *color2 = vertices[v].color;
}
void GfxGouraudTriangleShading::getParameterizedColor(double t, GfxColor *color) const {
More information about the poppler
mailing list