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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 773203003: Turn on MPD threading in nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: stack-copy 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 | « bench/nanobench.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index f01d55905824a34b3bfaa154fcaf0fb68c623abd..2e42ef1b9a2e3e76d41ee59982600d92b2ccbdd4 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -92,9 +92,9 @@ static bool valid_for_drawing(const SkBitmap& bm) {
return false; // no pixels to read
}
if (kIndex_8_SkColorType == bm.colorType()) {
- // ugh, I have to lock-pixels to inspect the colortable
- SkAutoLockPixels alp(bm);
- if (!bm.getColorTable()) {
+ SkBitmap copy(bm); // Locking and unlocking pixels is not thread safe,
+ SkAutoLockPixels alp(copy); // but we need to call it before getColorTable() is safe.
+ if (!copy.getColorTable()) {
return false;
}
}
« no previous file with comments | « bench/nanobench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698