Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 61153003: [PDF] Speculative fix for chrome crash w/ SRC xfer mode. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: if-else Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index ff7dd2cd9252475e46eed12a4c8d623a07f4eb68..0b15d6ab43915c591cbb09a0dfb8419af370ce64 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1948,7 +1948,14 @@ void SkPDFDevice::finishContentEntry(const SkXfermode::Mode xfermode,
SkPaint stockPaint;
- if (xfermode == SkXfermode::kClear_Mode) {
+ if (xfermode == SkXfermode::kSrcATop_Mode) {
+ ScopedContentEntry content(this, &clipStack, clipRegion, identity,
+ stockPaint);
+ if (content.entry()) {
+ SkPDFUtils::DrawFormXObject(this->addXObjectResource(dst),
+ &content.entry()->fContent);
+ }
+ } else if (xfermode == SkXfermode::kClear_Mode || !srcFormXObject.get()) {
return;
} else if (xfermode == SkXfermode::kSrc_Mode ||
xfermode == SkXfermode::kDstATop_Mode) {
@@ -1962,13 +1969,6 @@ void SkPDFDevice::finishContentEntry(const SkXfermode::Mode xfermode,
if (xfermode == SkXfermode::kSrc_Mode) {
return;
}
- } else if (xfermode == SkXfermode::kSrcATop_Mode) {
- ScopedContentEntry content(this, &clipStack, clipRegion, identity,
- stockPaint);
- if (content.entry()) {
- SkPDFUtils::DrawFormXObject(this->addXObjectResource(dst),
- &content.entry()->fContent);
- }
}
SkASSERT(xfermode == SkXfermode::kSrcIn_Mode ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698