diff options
-rw-r--r-- | include/gpu/GrContext.h | 16 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 2 |
2 files changed, 1 insertions, 17 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 9ccda23727..de80b6805e 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -19,7 +19,6 @@ #include "SkTypes.h" #include "../private/GrAuditTrail.h" #include "../private/GrSingleOwner.h" -#include "../private/SkMutex.h" struct GrBatchAtlasConfig; class GrBatchFontCache; @@ -415,18 +414,6 @@ private: bool fDidTestPMConversions; int fPMToUPMConversion; int fUPMToPMConversion; - // The sw backend may call GrContext::readSurfacePixels on multiple threads - // We may transfer the responsibilty for using a mutex to the sw backend - // when there are fewer code paths that lead to a readSurfacePixels call - // from the sw backend. readSurfacePixels is reentrant in one case - when performing - // the PM conversions test. To handle this we do the PM conversions test outside - // of fReadPixelsMutex and use a separate mutex to guard it. When it re-enters - // readSurfacePixels it will grab fReadPixelsMutex and release it before the outer - // readSurfacePixels proceeds to grab it. - // TODO: Stop pretending to make GrContext thread-safe for sw rasterization and provide - // a mechanism to make a SkPicture safe for multithreaded sw rasterization. - SkMutex fReadPixelsMutex; - SkMutex fTestPMConversionsMutex; // In debug builds we guard against improper thread handling // This guard is passed to the GrDrawingManager and, from there to all the @@ -465,8 +452,7 @@ private: sk_sp<GrFragmentProcessor> createUPMToPMEffect(GrTexture*, const GrSwizzle&, const SkMatrix&) const; /** Called before either of the above two functions to determine the appropriate fragment - processors for conversions. This must be called by readSurfacePixels before a mutex is - taken, since testingvPM conversions itself will call readSurfacePixels */ + processors for conversions. */ void testPMConversionsIfNecessary(uint32_t flags); /** Returns true if we've already determined that createPMtoUPMEffect and createUPMToPMEffect will fail. In such cases fall back to SW conversion. */ diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index ff5b0266e6..7dd01defe9 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -401,7 +401,6 @@ bool GrContext::readSurfacePixels(GrSurface* src, GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::readSurfacePixels"); this->testPMConversionsIfNecessary(flags); - SkAutoMutexAcquire ama(fReadPixelsMutex); // Adjust the params so that if we wind up using an intermediate surface we've already done // all the trimming and the temporary can be the min size required. @@ -853,7 +852,6 @@ void test_pm_conversions(GrContext* ctx, int* pmToUPMValue, int* upmToPMValue) { void GrContext::testPMConversionsIfNecessary(uint32_t flags) { ASSERT_SINGLE_OWNER if (SkToBool(kUnpremul_PixelOpsFlag & flags)) { - SkAutoMutexAcquire ama(fTestPMConversionsMutex); if (!fDidTestPMConversions) { test_pm_conversions(this, &fPMToUPMConversion, &fUPMToPMConversion); fDidTestPMConversions = true; |