aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-06-10 13:56:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-10 13:56:35 -0700
commitf10637f2795b147751ef413237389d230b869360 (patch)
treec541e51ce4ced899de02eaff49f06aa82f125fda /src/ports
parent8151103535bab8639dab2cb308b1b9c04651b632 (diff)
Type-erase SkAutoMutexAcquire and SkAutoExclusive.
This is purely for convenience, to not need to write the lock type in the guard anymore. This should all inline away. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2055023003 Review-Url: https://codereview.chromium.org/2055023003
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkScalerContext_win_dw.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 6f1d6fedc3..c9ff5d86c3 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -42,7 +42,6 @@
*/
static SkSharedMutex DWriteFactoryMutex;
-typedef SkAutoTExclusive<SkSharedMutex> Exclusive;
typedef SkAutoSharedMutexShared Shared;
static bool isLCD(const SkScalerContext::Rec& rec) {
@@ -50,7 +49,7 @@ static bool isLCD(const SkScalerContext::Rec& rec) {
}
static bool is_hinted_without_gasp(DWriteFontTypeface* typeface) {
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
AutoTDWriteTable<SkOTTableMaximumProfile> maxp(typeface->fDWriteFontFace.get());
if (!maxp.fExists) {
return false;
@@ -120,7 +119,7 @@ static void expand_range_if_gridfit_only(DWriteFontTypeface* typeface, int size,
}
static bool has_bitmap_strike(DWriteFontTypeface* typeface, PPEMRange range) {
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
{
AutoTDWriteTable<SkOTTableEmbeddedBitmapLocation> eblc(typeface->fDWriteFontFace.get());
if (!eblc.fExists) {
@@ -363,7 +362,7 @@ void SkScalerContext_DW::generateAdvance(SkGlyph* glyph) {
if (DWRITE_MEASURING_MODE_GDI_CLASSIC == fMeasuringMode ||
DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode)
{
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
HRVM(fTypeface->fDWriteFontFace->GetGdiCompatibleGlyphMetrics(
fTextSizeMeasure,
1.0f, // pixelsPerDip
@@ -373,7 +372,7 @@ void SkScalerContext_DW::generateAdvance(SkGlyph* glyph) {
&gm),
"Could not get gdi compatible glyph metrics.");
} else {
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
HRVM(fTypeface->fDWriteFontFace->GetDesignGlyphMetrics(&glyphId, 1, &gm),
"Could not get design metrics.");
}
@@ -432,7 +431,7 @@ HRESULT SkScalerContext_DW::getBoundingBox(SkGlyph* glyph,
SkTScopedComPtr<IDWriteGlyphRunAnalysis> glyphRunAnalysis;
{
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
HRM(fTypeface->fFactory->CreateGlyphRunAnalysis(
&run,
1.0f, // pixelsPerDip,
@@ -737,7 +736,7 @@ const void* SkScalerContext_DW::drawDWMask(const SkGlyph& glyph,
SkTScopedComPtr<IDWriteGlyphRunAnalysis> glyphRunAnalysis;
{
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
HRNM(fTypeface->fFactory->CreateGlyphRunAnalysis(&run,
1.0f, // pixelsPerDip,
&fXform,
@@ -821,7 +820,7 @@ void SkScalerContext_DW::generateColorGlyphImage(const SkGlyph& glyph) {
HRVM(SkDWriteGeometrySink::Create(&path, &geometryToPath),
"Could not create geometry to path converter.");
{
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
HRVM(colorGlyph->glyphRun.fontFace->GetGlyphRunOutline(
colorGlyph->glyphRun.fontEmSize,
colorGlyph->glyphRun.glyphIndices,
@@ -899,7 +898,7 @@ void SkScalerContext_DW::generatePath(const SkGlyph& glyph, SkPath* path) {
"Could not create geometry to path converter.");
uint16_t glyphId = glyph.getGlyphID();
{
- Exclusive l(DWriteFactoryMutex);
+ SkAutoExclusive l(DWriteFactoryMutex);
//TODO: convert to<->from DIUs? This would make a difference if hinting.
//It may not be needed, it appears that DirectWrite only hints at em size.
HRVM(fTypeface->fDWriteFontFace->GetGlyphRunOutline(SkScalarToFloat(fTextSizeRender),