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

Unified Diff: skia/ext/skia_utils_mac.mm

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « skia/ext/pixel_ref_utils.cc ('k') | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « skia/ext/pixel_ref_utils.cc ('k') | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698