diff options
-rw-r--r-- | bench/nanobench.cpp | 3 | ||||
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index b7603bf3bc..03fabc44f1 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -600,8 +600,7 @@ int nanobench_main(); int nanobench_main() { SetupCrashHandler(); SkAutoGraphics ag; - // Multithreading is disabled pending resolution of skia:3149 - //SkTaskGroup::Enabler enabled; + SkTaskGroup::Enabler enabled; #if SK_SUPPORT_GPU GrContext::Options grContextOpts; 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; } } |