entry->fMatrix = matrix;
entry->fClipStack = clipStack;
entry->fClipRegion = clipRegion;
+ entry->fColor = SkColorSetA(paint.getColor(), 0xFF);
+ entry->fShaderIndex = -1;
// PDF treats a shader as a color, so we only set one or the other.
SkRefPtr<SkPDFObject> pdfShader;
} else {
// A color shader is treated as an invalid shader so we don't have
// to set a shader just for a color.
- entry->fShaderIndex = -1;
- entry->fColor = 0;
- color = 0;
-
- // Check for a color shader.
SkShader::GradientInfo gradientInfo;
SkColor gradientColor;
gradientInfo.fColors = &gradientColor;
color = gradientColor;
}
}
- } else {
- entry->fShaderIndex = -1;
- entry->fColor = SkColorSetA(paint.getColor(), 0xFF);
- color = paint.getColor();
}
SkRefPtr<SkPDFGraphicState> newGraphicState;
SkPDFObject* result;
SkAutoMutexAcquire lock(CanonicalShadersMutex());
SkAutoTDelete<State> shaderState(new State(shader, matrix, surfaceBBox));
+ if (shaderState.get()->fType == SkShader::kNone_GradientType &&
+ shaderState.get()->fImage.isNull()) {
+ // TODO(vandebo) This drops SKComposeShader on the floor. We could
+ // handle compose shader by pulling things up to a layer, drawing with
+ // the first shader, applying the xfer mode and drawing again with the
+ // second shader, then applying the layer to the original drawing.
+ return NULL;
+ }
ShaderCanonicalEntry entry(NULL, shaderState.get());
int index = CanonicalShaders().find(entry);