initial clean up of pdf clipping
clipstack is always available, canvas checks for empty clips up-front Next step is to clarify if PDF wants to use Regions or Clipstack for its clipping (but not both) Change-Id: Iaf1fa35160291e08c33ff61114557deff72304b3 Reviewed-on: https://skia-review.googlesource.com/8692 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
ad2a2becb6
commit
afcd2e1398
@ -915,15 +915,12 @@ void SkPDFDevice::drawImage(const SkDraw& draw,
|
||||
SkScalar y,
|
||||
const SkPaint& srcPaint) {
|
||||
SkPaint paint = srcPaint;
|
||||
if (!image) {
|
||||
if (!image || draw.fRC->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (image->isOpaque()) {
|
||||
replace_srcmode_on_opaque_paint(&paint);
|
||||
}
|
||||
if (draw.fRC->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
SkImageSubset imageSubset(sk_ref_sp(const_cast<SkImage*>(image)));
|
||||
if (!imageSubset.isValid()) {
|
||||
return;
|
||||
@ -1758,23 +1755,6 @@ SkPDFDevice::ContentEntry* SkPDFDevice::setUpContentEntry(const SkClipStack* cli
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// The clip stack can come from an SkDraw where it is technically optional.
|
||||
SkClipStack synthesizedClipStack;
|
||||
if (clipStack == nullptr) {
|
||||
if (clipRegion == fExistingClipRegion) {
|
||||
clipStack = &fExistingClipStack;
|
||||
} else {
|
||||
// GraphicStackState::updateClip expects the clip stack to have
|
||||
// fExistingClip as a prefix, so start there, then set the clip
|
||||
// to the passed region.
|
||||
synthesizedClipStack = fExistingClipStack;
|
||||
SkPath clipPath;
|
||||
clipRegion.getBoundaryPath(&clipPath);
|
||||
synthesizedClipStack.clipPath(clipPath, SkMatrix::I(), kReplace_SkClipOp, false);
|
||||
clipStack = &synthesizedClipStack;
|
||||
}
|
||||
}
|
||||
|
||||
SkBlendMode blendMode = paint.getBlendMode();
|
||||
|
||||
// For the following modes, we want to handle source and destination
|
||||
|
Loading…
Reference in New Issue
Block a user