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

Unified Diff: chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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
Index: chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp
diff --git a/chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp b/chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp
index 03c3789caff3dbb43dc4f002c9803bc155ae97f2..b77a3bc256c86106611bf156e56b05dc212d5d56 100644
--- a/chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp
+++ b/chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric_cpu.cpp
@@ -53,8 +53,6 @@ bool SkDifferentPixelsMetric::diff(
// Prepare the pixels for comparison
result->poiCount = 0;
- baseline->lockPixels();
- test->lockPixels();
for (int y = 0; y < height; y++) {
// Grab a row from each image for easy comparison
// TODO(epoger): The code below already assumes 4 bytes per pixel, so I
@@ -102,23 +100,11 @@ bool SkDifferentPixelsMetric::diff(
}
}
}
- test->unlockPixels();
- baseline->unlockPixels();
result->maxRedDiff = maxRedDiff;
result->maxGreenDiff = maxGreenDiff;
result->maxBlueDiff = maxBlueDiff;
- if (bitmapsToCreate.alphaMask) {
- result->poiAlphaMask.unlockPixels();
- }
- if (bitmapsToCreate.rgbDiff) {
- result->rgbDiffBitmap.unlockPixels();
- }
- if (bitmapsToCreate.whiteDiff) {
- result->whiteDiffBitmap.unlockPixels();
- }
-
// Calculates the percentage of identical pixels
result->result = 1.0 - ((double)result->poiCount / (width * height));

Powered by Google App Engine
This is Rietveld 408576698