aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-09-09 18:05:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-09 18:05:03 -0700
commiteb662bc407cec0585a821946fef123102cae64db (patch)
tree953f4af97992459fb03bc237f99c1d5dbd7cfc96 /include/gpu
parentcb1ccfd2054d90c90772cd852c2a2df1ce5fb9eb (diff)
Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessing the same GrContext to read back GPU input data
BUG=chromium:524717 TBR=reed@google.com Review URL: https://codereview.chromium.org/1329313002
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrContext.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 7f1e4109fa..dcff3063b2 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -15,6 +15,7 @@
#include "GrRenderTarget.h"
#include "GrTextureProvider.h"
#include "SkMatrix.h"
+#include "SkMutex.h"
#include "SkPathEffect.h"
#include "SkTypes.h"
@@ -380,6 +381,11 @@ 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.
+ SkMutex fReadPixelsMutex;
struct CleanUpData {
PFCleanUpFunc fFunc;