Use SkMutex::assertHeld in SkPDFFont and SkPDFShader.
R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/348113002
This commit is contained in:
parent
9e64b78ff6
commit
24480bc71e
@ -872,15 +872,13 @@ SkPDFFont* SkPDFFont::getFontSubset(const SkPDFGlyphSet*) {
|
||||
|
||||
// static
|
||||
SkTDArray<SkPDFFont::FontRec>& SkPDFFont::CanonicalFonts() {
|
||||
// This initialization is only thread safe with gcc.
|
||||
SkPDFFont::CanonicalFontsMutex().assertHeld();
|
||||
static SkTDArray<FontRec> gCanonicalFonts;
|
||||
return gCanonicalFonts;
|
||||
}
|
||||
|
||||
// static
|
||||
SkBaseMutex& SkPDFFont::CanonicalFontsMutex() {
|
||||
// This initialization is only thread safe with gcc, or when
|
||||
// POD-style mutex initialization is used.
|
||||
SK_DECLARE_STATIC_MUTEX(gCanonicalFontsMutex);
|
||||
return gCanonicalFontsMutex;
|
||||
}
|
||||
|
@ -659,22 +659,20 @@ SkPDFObject* SkPDFShader::GetPDFShader(const SkShader& shader,
|
||||
|
||||
// static
|
||||
SkTDArray<SkPDFShader::ShaderCanonicalEntry>& SkPDFShader::CanonicalShaders() {
|
||||
// This initialization is only thread safe with gcc.
|
||||
SkPDFShader::CanonicalShadersMutex().assertHeld();
|
||||
static SkTDArray<ShaderCanonicalEntry> gCanonicalShaders;
|
||||
return gCanonicalShaders;
|
||||
}
|
||||
|
||||
// static
|
||||
SkBaseMutex& SkPDFShader::CanonicalShadersMutex() {
|
||||
// This initialization is only thread safe with gcc or when
|
||||
// POD-style mutex initialization is used.
|
||||
SK_DECLARE_STATIC_MUTEX(gCanonicalShadersMutex);
|
||||
return gCanonicalShadersMutex;
|
||||
}
|
||||
|
||||
// static
|
||||
SkPDFObject* SkPDFFunctionShader::RangeObject() {
|
||||
// This initialization is only thread safe with gcc.
|
||||
SkPDFShader::CanonicalShadersMutex().assertHeld();
|
||||
static SkPDFArray* range = NULL;
|
||||
// This method is only used with CanonicalShadersMutex, so it's safe to
|
||||
// populate domain.
|
||||
|
Loading…
Reference in New Issue
Block a user