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

Unified Diff: gm/xfermodes.cpp

Issue 125293004: Merge 12729 "[PDF] Fix clipping in xfermode improvement." (Closed) Base URL: http://skia.googlecode.com/svn/branches/chrome/m33_1750/
Patch Set: Created 6 years, 11 months 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 | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes.cpp
===================================================================
--- gm/xfermodes.cpp (revision 12933)
+++ gm/xfermodes.cpp (working copy)
@@ -66,8 +66,10 @@
kQuarterClearInLayer_SrcType = 0x20,
//! A W/2xH/2 transparent image.
kSmallTransparentImage_SrcType = 0x40,
+ //! kRectangleImage_SrcType drawn directly with a mask.
+ kRectangleWithMask_SrcType = 0x80,
- kAll_SrcType = 0x7F, //!< All the source types.
+ kAll_SrcType = 0xFF, //!< All the source types.
kBasic_SrcType = 0x03, //!< Just basic source types.
};
@@ -112,6 +114,15 @@
canvas->drawRect(r, p);
break;
}
+ case kRectangleWithMask_SrcType: {
+ canvas->save(SkCanvas::kClip_SaveFlag);
+ restoreNeeded = true;
+ SkScalar w = SkIntToScalar(W);
+ SkScalar h = SkIntToScalar(H);
+ SkRect r = SkRect::MakeXYWH(x, y + h / 4, w, h * 23 / 60);
+ canvas->clipRect(r);
+ // Fall through.
+ }
case kRectangle_SrcType: {
SkScalar w = SkIntToScalar(W);
SkScalar h = SkIntToScalar(H);
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698