WebKit Bugzilla
Attachment 357510 Details for
Bug 192752
: [Win][Clang] Fix compilation warnings under WebCore/platform/graphics directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192752-20181218110928.patch (text/plain), 13.02 KB, created by
Fujii Hironori
on 2018-12-17 18:09:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-12-17 18:09:29 PST
Size:
13.02 KB
patch
obsolete
>Subversion Revision: 239306 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8617b0206a913fb8290f20f4b218659508556948..b1bee12e3c70acabfc57471e976076c0534a1ee1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,39 @@ >+2018-12-17 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory >+ https://bugs.webkit.org/show_bug.cgi?id=192752 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, no behavior changes. >+ >+ * platform/graphics/win/DIBPixelData.cpp: >+ Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG. >+ * platform/graphics/win/FontPlatformDataWin.cpp: >+ (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT. >+ * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'. >+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: >+ Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample. >+ (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation): >+ Reorder the initializer list. >+ (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT. >+ (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto. >+ (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto. >+ (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto. >+ (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto. >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case. >+ * platform/graphics/win/SimpleFontDataCairoWin.cpp: >+ (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2. >+ * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'. >+ (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2. >+ (WebCore::Font::boundsForGDIGlyph const): Ditto. >+ (WebCore::Font::widthForGDIGlyph const): Ditto. >+ * platform/graphics/win/UniscribeController.cpp: >+ (WebCore::UniscribeController::UniscribeController): >+ Reorder the initializer list. >+ (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||. >+ (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'. >+ > 2018-12-17 Simon Fraser <simon.fraser@apple.com> > > Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled >diff --git a/Source/WebCore/platform/graphics/win/DIBPixelData.cpp b/Source/WebCore/platform/graphics/win/DIBPixelData.cpp >index a8fac23620a4042781a2a226996184dfaf3341f9..c0a9dfcc4d6da947a31ece3716e72068cd4049c5 100644 >--- a/Source/WebCore/platform/graphics/win/DIBPixelData.cpp >+++ b/Source/WebCore/platform/graphics/win/DIBPixelData.cpp >@@ -28,8 +28,10 @@ > > namespace WebCore { > >+#ifndef NDEBUG > static const WORD bitmapType = 0x4d42; // BMP format > static const WORD bitmapPixelsPerMeter = 2834; // 72 dpi >+#endif > > DIBPixelData::DIBPixelData(HBITMAP bitmap) > { >diff --git a/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp b/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp >index 26c042188988df54bea89df7eeaaf8ed0f6f3348..223a9d3f010b2dbb883cfba5d387cd2fc5cbd8ea 100644 >--- a/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp >+++ b/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp >@@ -80,7 +80,7 @@ RefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const > if (size != GDI_ERROR) { > Vector<char> data(size); > DWORD result = GetFontData(hdc, table, 0, (PVOID)data.data(), size); >- ASSERT(result == size); >+ ASSERT_UNUSED(result, result == size); > buffer = SharedBuffer::create(WTFMove(data)); > } > >diff --git a/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp b/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp >index 72b134712841a125fd0cddb0e80f556e097ef38b..75039e381540c1d4be14b3742a6b406eb39a25f8 100644 >--- a/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp >+++ b/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp >@@ -186,8 +186,6 @@ void GraphicsContextPlatformPrivate::scale(const FloatSize& size) > ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY); > } > >-static const double deg2rad = 0.017453292519943295769; // pi/180 >- > void GraphicsContextPlatformPrivate::rotate(float degreesAngle) > { > XFORM xform = TransformationMatrix().rotate(degreesAngle); >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >index 1da241c27608a1be275339a88daecfaaa50b6624..c848b61b9c58d8f29f1ebb3096bca1172de1b327 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >@@ -54,14 +54,11 @@ SOFT_LINK_OPTIONAL(Mf, MFCreateTopologyNode, HRESULT, STDAPICALLTYPE, (MF_TOPOLO > SOFT_LINK_OPTIONAL(Mf, MFGetService, HRESULT, STDAPICALLTYPE, (IUnknown*, REFGUID, REFIID, LPVOID*)); > SOFT_LINK_OPTIONAL(Mf, MFCreateAudioRendererActivate, HRESULT, STDAPICALLTYPE, (IMFActivate**)); > SOFT_LINK_OPTIONAL(Mf, MFCreateVideoRendererActivate, HRESULT, STDAPICALLTYPE, (HWND, IMFActivate**)); >-SOFT_LINK_OPTIONAL(Mf, MFCreateSampleGrabberSinkActivate, HRESULT, STDAPICALLTYPE, (IMFMediaType*, IMFSampleGrabberSinkCallback*, IMFActivate**)); > SOFT_LINK_OPTIONAL(Mf, MFGetSupportedMimeTypes, HRESULT, STDAPICALLTYPE, (PROPVARIANT*)); > > SOFT_LINK_LIBRARY(Mfplat); > SOFT_LINK_OPTIONAL(Mfplat, MFStartup, HRESULT, STDAPICALLTYPE, (ULONG, DWORD)); > SOFT_LINK_OPTIONAL(Mfplat, MFShutdown, HRESULT, STDAPICALLTYPE, ()); >-SOFT_LINK_OPTIONAL(Mfplat, MFCreateMemoryBuffer, HRESULT, STDAPICALLTYPE, (DWORD, IMFMediaBuffer**)); >-SOFT_LINK_OPTIONAL(Mfplat, MFCreateSample, HRESULT, STDAPICALLTYPE, (IMFSample**)); > SOFT_LINK_OPTIONAL(Mfplat, MFCreateMediaType, HRESULT, STDAPICALLTYPE, (IMFMediaType**)); > SOFT_LINK_OPTIONAL(Mfplat, MFFrameRateToAverageTimePerFrame, HRESULT, STDAPICALLTYPE, (UINT32, UINT32, UINT64*)); > >@@ -95,8 +92,8 @@ MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer > , m_hasAudio(false) > , m_hasVideo(false) > , m_preparingToPlay(false) >- , m_hwndVideo(nullptr) > , m_volume(1.0) >+ , m_hwndVideo(nullptr) > , m_networkState(MediaPlayer::Empty) > , m_readyState(MediaPlayer::HaveNothing) > { >@@ -253,7 +250,7 @@ void MediaPlayerPrivateMediaFoundation::seek(float time) > propVariant.hVal.QuadPart = static_cast<__int64>(time * tenMegahertz); > > HRESULT hr = m_mediaSession->Start(&GUID_NULL, &propVariant); >- ASSERT(SUCCEEDED(hr)); >+ ASSERT_UNUSED(hr, SUCCEEDED(hr)); > PropVariantClear(&propVariant); > > m_player->timeChanged(); >@@ -314,7 +311,7 @@ bool MediaPlayerPrivateMediaFoundation::setAllChannelVolumes(float volume) > > UINT32 channelsCount; > HRESULT hr = audioVolume->GetChannelCount(&channelsCount); >- ASSERT(SUCCEEDED(hr)); >+ ASSERT_UNUSED(hr, SUCCEEDED(hr)); > > Vector<float> volumes(channelsCount, volume); > return SUCCEEDED(audioVolume->SetAllVolumes(channelsCount, volumes.data())); >@@ -426,7 +423,7 @@ bool MediaPlayerPrivateMediaFoundation::createSession() > // Get next event. > AsyncCallback* callback = new AsyncCallback(this, true); > HRESULT hr = m_mediaSession->BeginGetEvent(callback, nullptr); >- ASSERT(SUCCEEDED(hr)); >+ ASSERT_UNUSED(hr, SUCCEEDED(hr)); > > return true; > } >@@ -459,7 +456,7 @@ bool MediaPlayerPrivateMediaFoundation::endSession() > return false; > > HRESULT hr = MFShutdownPtr()(); >- ASSERT(SUCCEEDED(hr)); >+ ASSERT_UNUSED(hr, SUCCEEDED(hr)); > > return true; > } >@@ -905,7 +902,7 @@ void MediaPlayerPrivateMediaFoundation::onCreatedMediaSource() > > // Set the topology on the media session. > HRESULT hr = m_mediaSession->SetTopology(0, m_topology.get()); >- ASSERT(SUCCEEDED(hr)); >+ ASSERT_UNUSED(hr, SUCCEEDED(hr)); > } > > void MediaPlayerPrivateMediaFoundation::onTopologySet() >@@ -2963,6 +2960,8 @@ void MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame(Web > case D3DFMT_X8R8G8B8: > cairoFormat = CAIRO_FORMAT_RGB24; > break; >+ default: >+ break; > } > > ASSERT(cairoFormat != CAIRO_FORMAT_INVALID); >diff --git a/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp b/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >index 2c711b8c954665eb26ca78e4ada883ae110177c3..157f80b51f2b8a7eb08d08a39250c7a61c6aa1f8 100644 >--- a/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >+++ b/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >@@ -116,7 +116,7 @@ FloatRect Font::platformBoundsForGlyph(Glyph glyph) const > cairo_win32_scaled_font_select_font(scaledFont, dc); > > GLYPHMETRICS gdiMetrics; >- static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; >+ static const MAT2 identity = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; > GetGlyphOutline(dc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity); > > cairo_win32_scaled_font_done_font(scaledFont); >diff --git a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >index 562d2d4173c78c30a952f3f59449370fdf4c660f..143545f90bec869356e3fdc83a865876a948c78e 100644 >--- a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >+++ b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >@@ -43,8 +43,6 @@ > > namespace WebCore { > >-const float cSmallCapsFontSizeMultiplier = 0.7f; >- > static bool g_shouldApplyMacAscentHack; > > void Font::setShouldApplyMacAscentHack(bool b) >@@ -110,7 +108,7 @@ void Font::initGDIFont() > m_maxCharWidth = textMetrics.tmMaxCharWidth; > float xHeight = ascent * 0.56f; // Best guess for xHeight if no x glyph is present. > GLYPHMETRICS gm; >- static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; >+ static const MAT2 identity = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; > DWORD len = GetGlyphOutline(hdc, 'x', GGO_METRICS, &gm, 0, 0, &identity); > if (len != GDI_ERROR && gm.gmptGlyphOrigin.y > 0) > xHeight = gm.gmptGlyphOrigin.y; >@@ -177,7 +175,7 @@ FloatRect Font::boundsForGDIGlyph(Glyph glyph) const > HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont()); > > GLYPHMETRICS gdiMetrics; >- static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; >+ static const MAT2 identity = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; > GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity); > > SelectObject(hdc, oldFont); >@@ -193,7 +191,7 @@ float Font::widthForGDIGlyph(Glyph glyph) const > HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont()); > > GLYPHMETRICS gdiMetrics; >- static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; >+ static const MAT2 identity = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; > GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity); > float result = gdiMetrics.gmCellIncX + m_syntheticBoldOffset; > >diff --git a/Source/WebCore/platform/graphics/win/UniscribeController.cpp b/Source/WebCore/platform/graphics/win/UniscribeController.cpp >index 0b61626d453ab7d1ac8ea82421b116c0f5d556c1..ff37ac56ec16825e65635ca09d0b7a03180df8a4 100644 >--- a/Source/WebCore/platform/graphics/win/UniscribeController.cpp >+++ b/Source/WebCore/platform/graphics/win/UniscribeController.cpp >@@ -50,8 +50,8 @@ UniscribeController::UniscribeController(const FontCascade* font, const TextRun& > , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) > , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) > , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) >- , m_end(run.length()) > , m_currentCharacter(0) >+ , m_end(run.length()) > , m_runWidthSoFar(0) > , m_padding(run.expansion()) > , m_computingOffsetPosition(false) >@@ -87,7 +87,7 @@ int UniscribeController::offsetForPosition(int x, bool includePartialGlyphs) > advance(m_run.length()); > if (m_computingOffsetPosition) { > // The point is to the left or to the right of the entire run. >- if (m_offsetX >= m_runWidthSoFar && m_run.ltr() || m_offsetX < 0 && m_run.rtl()) >+ if ((m_offsetX >= m_runWidthSoFar && m_run.ltr()) || (m_offsetX < 0 && m_run.rtl())) > m_offsetPosition = m_end; > } > m_computingOffsetPosition = false; >@@ -260,7 +260,6 @@ bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned i, const F > Vector<int> advances; > offsets.resize(glyphs.size()); > advances.resize(glyphs.size()); >- int glyphCount = 0; > HRESULT placeResult = ScriptPlace(0, fontData->scriptCache(), glyphs.data(), glyphs.size(), visualAttributes.data(), > &item.a, advances.data(), offsets.data(), 0); > if (placeResult == E_PENDING) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192752
:
357432
| 357510