aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-12-03 13:07:39 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-03 13:07:39 -0800
commit4f10844149bbc05f0259a1b3199c2f995756ed60 (patch)
tree7240e727ca5b50037728704315e55fadc72978af /src
parent4de8a4dcf70fdaef7ff4e875e6f7c018053491d7 (diff)
Turn on MPD threading in nanobench.
Seems okay after this small patch to skip lockPixels() / unlockPixels(). BUG=skia:3149 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot Review URL: https://codereview.chromium.org/773203003
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcShader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index f01d559058..2e42ef1b9a 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;
}
}