Index: skia/ext/skia_utils_mac.mm |
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm |
index dd8f560e1d9cd7632265eea9980794bb4bbcd692..9e552eb77b0da67f5a6a5f99a11fd056c9d1ba65 100644 |
--- a/skia/ext/skia_utils_mac.mm |
+++ b/skia/ext/skia_utils_mac.mm |
@@ -376,16 +376,9 @@ void SkiaBitLocker::releaseIfNeeded() { |
if (!bitmap_.extractSubset(&subset, bounds)) { |
return; |
} |
- // Neutralize the global matrix by concatenating the inverse. In the |
- // future, Skia may provide some mechanism to set the device portion of |
- // the matrix to identity without clobbering any hosting matrix (e.g., the |
- // picture's matrix). |
- const SkMatrix& skMatrix = canvas_->getTotalMatrix(); |
- SkMatrix inverse; |
- if (!skMatrix.invert(&inverse)) |
- return; |
+ subset.setImmutable(); // Prevents a defensive copy inside Skia. |
canvas_->save(); |
- canvas_->concat(inverse); |
+ canvas_->setMatrix(SkMatrix::I()); // Reset back to device space. |
canvas_->translate(bounds.x() + bitmapOffset_.x(), |
bounds.y() + bitmapOffset_.y()); |
canvas_->scale(1.f / bitmapScaleFactor_, 1.f / bitmapScaleFactor_); |