Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: src/ports/SkScalerContext_win_dw.cpp

Issue 2055023003: Type-erase SkAutoMutexAcquire and SkAutoExclusive. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkScalerContext_win_dw.cpp
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index 6f1d6fedc324c0d7199674c8a459dff5a1c78325..c9ff5d86c35e2f8efd0eb5aec882631b0cd2fb13 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),
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698