| Index: skia/ext/platform_device_win.cc
|
| ===================================================================
|
| --- skia/ext/platform_device_win.cc (revision 13611)
|
| +++ skia/ext/platform_device_win.cc (working copy)
|
| @@ -200,20 +200,21 @@
|
| // region can be empty, in which case everything will be clipped.
|
| hrgn = CreateRectRgn(0, 0, 0, 0);
|
| } else if (region.isRect()) {
|
| - // Do the transformation.
|
| - SkRect rect;
|
| - rect.set(region.getBounds());
|
| - transformation.mapRect(&rect);
|
| - SkIRect irect;
|
| - rect.round(&irect);
|
| - hrgn = CreateRectRgnIndirect(&SkIRectToRECT(irect));
|
| + // We don't apply transformation, because the translation is already applied
|
| + // to the region.
|
| + hrgn = CreateRectRgnIndirect(&SkIRectToRECT(region.getBounds()));
|
| } else {
|
| // It is complex.
|
| SkPath path;
|
| region.getBoundaryPath(&path);
|
| // Clip. Note that windows clipping regions are not affected by the
|
| // transform so apply it manually.
|
| - path.transform(transformation);
|
| + // Since the transform is given as the original translation of canvas, we
|
| + // should apply it in reverse.
|
| + SkMatrix t(transformation);
|
| + t.setTranslateX(-t.getTranslateX());
|
| + t.setTranslateY(-t.getTranslateY());
|
| + path.transform(t);
|
| LoadPathToDC(context, path);
|
| hrgn = PathToRegion(context);
|
| }
|
|
|