aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-07-02 11:46:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-02 18:16:26 +0000
commit628df2aa24c660ca0a66c9677287cfc803b637e9 (patch)
tree848384a35c9938eeaf881e27dde931b36278a255 /src
parente04b19ed478f3c0956acfe9c4d3b31941d28412a (diff)
Fix race condition in GrGLCaps
Bug: 854778 Change-Id: I3421360a8549e231f508f28d3945d81f811e66de Reviewed-on: https://skia-review.googlesource.com/138923 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 38435ccb18..b9c19c7c65 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -206,7 +206,7 @@ public:
* using isConfigVerifiedColorAttachment().
*/
void markConfigAsValidColorAttachment(GrPixelConfig config) {
- fConfigTable[config].fFlags |= ConfigInfo::kVerifiedColorAttachment_Flag;
+ fConfigTable[config].fVerifiedColorAttachment = true;
}
/**
@@ -214,7 +214,7 @@ public:
* attachment.
*/
bool isConfigVerifiedColorAttachment(GrPixelConfig config) const {
- return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kVerifiedColorAttachment_Flag);
+ return fConfigTable[config].fVerifiedColorAttachment;
}
/**
@@ -588,18 +588,21 @@ private:
SkTDArray<int> fColorSampleCounts;
enum {
- kVerifiedColorAttachment_Flag = 0x1,
- kTextureable_Flag = 0x2,
- kRenderable_Flag = 0x4,
- kRenderableWithMSAA_Flag = 0x8,
+ kTextureable_Flag = 0x1,
+ kRenderable_Flag = 0x2,
+ kRenderableWithMSAA_Flag = 0x4,
/** kFBOColorAttachment means that even if the config cannot be a GrRenderTarget, we can
still attach it to a FBO for blitting or reading pixels. */
- kFBOColorAttachment_Flag = 0x10,
- kCanUseTexStorage_Flag = 0x20,
- kCanUseWithTexelBuffer_Flag = 0x40,
+ kFBOColorAttachment_Flag = 0x8,
+ kCanUseTexStorage_Flag = 0x10,
+ kCanUseWithTexelBuffer_Flag = 0x20,
};
uint32_t fFlags;
+ // verification of color attachment validity is done while flushing. Although only ever
+ // used in the (sole) rendering thread it can cause races if it is glommed into fFlags.
+ bool fVerifiedColorAttachment = false;
+
GrSwizzle fSwizzle;
};