Bug 1328337 - fix implicit conversion of glyph size from float to uint32_t in NativeFontResource::CreateScaledFont. r=bobowen
authorLee Salzman <lsalzman@mozilla.com>
Tue, 03 Jan 2017 14:20:16 -0500
changeset 327818 aea479acaeb8ed3ac0f48235ff349042b82a61ba
parent 327817 78d315ef8ebf104b3707979c2f5dfff0900c250d
child 327819 a2059d25a0aec35af01993f1f2dd68144921e94e
push id85291
push userlsalzman@mozilla.com
push dateTue, 03 Jan 2017 19:20:32 +0000
treeherdermozilla-inbound@aea479acaeb8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs1328337
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1328337 - fix implicit conversion of glyph size from float to uint32_t in NativeFontResource::CreateScaledFont. r=bobowen MozReview-Commit-ID: 9JcrfRYJ3ca
gfx/2d/2D.h
gfx/2d/NativeFontResourceDWrite.cpp
gfx/2d/NativeFontResourceDWrite.h
gfx/2d/NativeFontResourceGDI.cpp
gfx/2d/NativeFontResourceGDI.h
gfx/2d/NativeFontResourceMac.cpp
gfx/2d/NativeFontResourceMac.h
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -736,17 +736,17 @@ public:
    * Creates a ScaledFont using the font corresponding to the index and
    * the given glyph size.
    *
    * @param aIndex index for the font within the resource.
    * @param aGlyphSize the size of ScaledFont required.
    * @return an already_addrefed ScaledFont, containing nullptr if failed.
    */
   virtual already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) = 0;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) = 0;
 
   virtual ~NativeFontResource() {};
 };
 
 /** This class is designed to allow passing additional glyph rendering
  * parameters to the glyph drawing functions. This is an empty wrapper class
  * merely used to allow holding on to and passing around platform specific
  * parameters. This is because different platforms have unique rendering
--- a/gfx/2d/NativeFontResourceDWrite.cpp
+++ b/gfx/2d/NativeFontResourceDWrite.cpp
@@ -254,17 +254,17 @@ NativeFontResourceDWrite::Create(uint8_t
 
   RefPtr<NativeFontResourceDWrite> fontResource =
     new NativeFontResourceDWrite(factory, fontFile.forget(), faceType,
                                  numberOfFaces, aNeedsCairo);
   return fontResource.forget();
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceDWrite::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceDWrite::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   if (aIndex >= mNumberOfFaces) {
     gfxWarning() << "Font face index is too high for font resource.";
     return nullptr;
   }
 
   IDWriteFontFile *fontFile = mFontFile;
   RefPtr<IDWriteFontFace> fontFace;
--- a/gfx/2d/NativeFontResourceDWrite.h
+++ b/gfx/2d/NativeFontResourceDWrite.h
@@ -27,17 +27,17 @@ public:
    * @param aDataLength length of data.
    * @param aNeedsCairo whether the ScaledFont created needs a cairo scaled font
    * @return Referenced NativeFontResourceDWrite or nullptr if invalid.
    */
   static already_AddRefed<NativeFontResourceDWrite>
     Create(uint8_t *aFontData, uint32_t aDataLength, bool aNeedsCairo);
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) final;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) final;
 
 private:
   NativeFontResourceDWrite(IDWriteFactory *aFactory,
                            already_AddRefed<IDWriteFontFile> aFontFile,
                            DWRITE_FONT_FACE_TYPE aFaceType,
                            uint32_t aNumberOfFaces, bool aNeedsCairo)
     : mFactory(aFactory), mFontFile(aFontFile), mFaceType(aFaceType)
     , mNumberOfFaces(aNumberOfFaces), mNeedsCairo(aNeedsCairo)
--- a/gfx/2d/NativeFontResourceGDI.cpp
+++ b/gfx/2d/NativeFontResourceGDI.cpp
@@ -60,17 +60,17 @@ NativeFontResourceGDI::Create(uint8_t *a
 }
 
 NativeFontResourceGDI::~NativeFontResourceGDI()
 {
   ::RemoveFontMemResourceEx(mFontResourceHandle);
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceGDI::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceGDI::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   if (aIndex >= mFontNames.length()) {
     gfxWarning() << "Font index is too high for font resource.";
     return nullptr;
   }
 
   if (mFontNames[aIndex].empty()) {
     gfxWarning() << "Font name for index is empty.";
--- a/gfx/2d/NativeFontResourceGDI.h
+++ b/gfx/2d/NativeFontResourceGDI.h
@@ -31,17 +31,17 @@ public:
    * @return Referenced NativeFontResourceGDI or nullptr if invalid.
    */
   static already_AddRefed<NativeFontResourceGDI>
     Create(uint8_t *aFontData, uint32_t aDataLength, bool aNeedsCairo);
 
   ~NativeFontResourceGDI();
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) final;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) final;
 
 private:
   NativeFontResourceGDI(HANDLE aFontResourceHandle,
                         Vector<mozilla::u16string>&& aFontNames,
                         bool aNeedsCairo)
     : mFontResourceHandle(aFontResourceHandle), mFontNames(Move(aFontNames))
     , mNeedsCairo(aNeedsCairo)
   {}
--- a/gfx/2d/NativeFontResourceMac.cpp
+++ b/gfx/2d/NativeFontResourceMac.cpp
@@ -45,17 +45,17 @@ NativeFontResourceMac::Create(uint8_t *a
   // passes ownership of fontRef to the NativeFontResourceMac instance
   RefPtr<NativeFontResourceMac> fontResource =
     new NativeFontResourceMac(fontRef);
 
   return fontResource.forget();
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceMac::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceMac::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   RefPtr<ScaledFontBase> scaledFont = new ScaledFontMac(mFontRef, aGlyphSize);
 
   if (!scaledFont->PopulateCairoScaledFont()) {
     gfxWarning() << "Unable to create cairo scaled Mac font.";
     return nullptr;
   }
 
--- a/gfx/2d/NativeFontResourceMac.h
+++ b/gfx/2d/NativeFontResourceMac.h
@@ -18,17 +18,17 @@ class NativeFontResourceMac final : publ
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceMac)
 
   static already_AddRefed<NativeFontResourceMac>
     Create(uint8_t *aFontData, uint32_t aDataLength);
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize);
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize);
 
   ~NativeFontResourceMac()
   {
     CFRelease(mFontRef);
   }
 
 private:
   explicit NativeFontResourceMac(CGFontRef aFontRef) : mFontRef(aFontRef) {}