Bug 1343516 - make all methods 'const' for the abstract class of PropertyProvider. draft
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 15 Mar 2017 16:25:25 +0800
changeset 498981 bfcd0eae2fa4bfe35848868fec8b407dc8ed3803
parent 498697 8dd496fd015a2b6e99573070279d9d1593836ea9
child 498982 ac9eabbc83d6020d0caaa37763029563c8e29ed1
push id49300
push userjichen@mozilla.com
push dateWed, 15 Mar 2017 08:26:24 +0000
bugs1343516
milestone55.0a1
Bug 1343516 - make all methods 'const' for the abstract class of PropertyProvider. MozReview-Commit-ID: 4AWqnxKFogM
gfx/thebes/gfxTextRun.h
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -200,44 +200,44 @@ public:
      * is unable to apply it in some context. Exception: spacing around a
      * whitespace character MUST always be applied.
      */
     class PropertyProvider {
     public:
         // Detect hyphenation break opportunities in the given range; breaks
         // not at cluster boundaries will be ignored.
         virtual void GetHyphenationBreaks(Range aRange,
-                                          HyphenType *aBreakBefore) = 0;
+                                          HyphenType *aBreakBefore) const = 0;
 
         // Returns the provider's hyphenation setting, so callers can decide
         // whether it is necessary to call GetHyphenationBreaks.
         // Result is an StyleHyphens value.
-        virtual mozilla::StyleHyphens GetHyphensOption() = 0;
+        virtual mozilla::StyleHyphens GetHyphensOption() const = 0;
 
         // Returns the extra width that will be consumed by a hyphen. This should
         // be constant for a given textrun.
-        virtual gfxFloat GetHyphenWidth() = 0;
+        virtual gfxFloat GetHyphenWidth() const = 0;
 
         typedef gfxFont::Spacing Spacing;
 
         /**
          * Get the spacing around the indicated characters. Spacing must be zero
          * inside clusters. In other words, if character i is not
          * CLUSTER_START, then character i-1 must have zero after-spacing and
          * character i must have zero before-spacing.
          */
-        virtual void GetSpacing(Range aRange, Spacing *aSpacing) = 0;
+        virtual void GetSpacing(Range aRange, Spacing *aSpacing) const = 0;
 
         // Returns a gfxContext that can be used to measure the hyphen glyph.
         // Only called if the hyphen width is requested.
-        virtual already_AddRefed<DrawTarget> GetDrawTarget() = 0;
+        virtual already_AddRefed<DrawTarget> GetDrawTarget() const = 0;
 
         // Return the appUnitsPerDevUnit value to be used when measuring.
         // Only called if the hyphen width is requested.
-        virtual uint32_t GetAppUnitsPerDevUnit() = 0;
+        virtual uint32_t GetAppUnitsPerDevUnit() const = 0;
     };
 
     struct DrawParams
     {
         gfxContext* context;
         DrawMode drawMode = DrawMode::GLYPH_FILL;
         nscolor textStrokeColor = 0;
         gfxPattern* textStrokePattern = nullptr;