Bug 832554: Add #ifdef guards around static functions in /gfx/thebes that aren't used on android, to fix android-only -Wunused-function build warnings. r=BenWa a=nonlibxul
--- a/gfx/thebes/gfxFT2Fonts.cpp
+++ b/gfx/thebes/gfxFT2Fonts.cpp
@@ -34,38 +34,38 @@
#include "nsCRT.h"
#include "nsXULAppAPI.h"
#include "prlog.h"
#include "prinit.h"
#include "mozilla/Preferences.h"
-static PRLogModuleInfo *
-GetFontLog()
-{
- static PRLogModuleInfo *sLog;
- if (!sLog)
- sLog = PR_NewLogModule("ft2fonts");
- return sLog;
-}
-
// rounding and truncation functions for a Freetype floating point number
// (FT26Dot6) stored in a 32bit integer with high 26 bits for the integer
// part and low 6 bits for the fractional part.
#define MOZ_FT_ROUND(x) (((x) + 32) & ~63) // 63 = 2^6 - 1
#define MOZ_FT_TRUNC(x) ((x) >> 6)
#define CONVERT_DESIGN_UNITS_TO_PIXELS(v, s) \
MOZ_FT_TRUNC(MOZ_FT_ROUND(FT_MulFix((v) , (s))))
#ifndef ANDROID // not needed on Android, we use the generic gfxFontGroup
/**
* gfxFT2FontGroup
*/
+static PRLogModuleInfo *
+GetFontLog()
+{
+ static PRLogModuleInfo *sLog;
+ if (!sLog)
+ sLog = PR_NewLogModule("ft2fonts");
+ return sLog;
+}
+
bool
gfxFT2FontGroup::FontCallback(const nsAString& fontName,
const nsACString& genericName,
bool aUseFontSet,
void *closure)
{
nsTArray<nsString> *sa = static_cast<nsTArray<nsString>*>(closure);
--- a/gfx/thebes/gfxFontMissingGlyphs.cpp
+++ b/gfx/thebes/gfxFontMissingGlyphs.cpp
@@ -139,32 +139,34 @@ static const int BOX_BORDER_WIDTH = 1;
static const gfxFloat BOX_BORDER_OPACITY = 0.5;
/**
* Draw a single hex character using the current color. A nice way to do this
* would be to fill in an A8 image surface and then use it as a mask
* to paint the current color. Tragically this doesn't currently work with the
* Quartz cairo backend which doesn't generally support masking with surfaces.
* So for now we just paint a bunch of rectangles...
*/
+#ifndef MOZ_GFX_OPTIMIZE_MOBILE
static void
DrawHexChar(gfxContext *aContext, const gfxPoint& aPt, uint32_t aDigit)
{
aContext->NewPath();
uint32_t glyphBits = glyphMicroFont[aDigit];
int x, y;
for (y = 0; y < MINIFONT_HEIGHT; ++y) {
for (x = 0; x < MINIFONT_WIDTH; ++x) {
if (glyphBits & 1) {
aContext->Rectangle(gfxRect(x, y, 1, 1) + aPt, true);
}
glyphBits >>= 1;
}
}
aContext->Fill();
}
+#endif // MOZ_GFX_OPTIMIZE_MOBILE
void
gfxFontMissingGlyphs::DrawMissingGlyph(gfxContext *aContext, const gfxRect& aRect,
uint32_t aChar)
{
aContext->Save();
gfxRGBA currentColor;
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -205,16 +205,17 @@ OptimalFillOperator()
} else {
#endif
return gfxContext::OPERATOR_SOURCE;
#ifdef XP_WIN
}
#endif
}
+#ifndef MOZ_GFX_OPTIMIZE_MOBILE
// EXTEND_PAD won't help us here; we have to create a temporary surface to hold
// the subimage of pixels we're allowed to sample.
static already_AddRefed<gfxDrawable>
CreateSamplingRestrictedDrawable(gfxDrawable* aDrawable,
gfxContext* aContext,
const gfxMatrix& aUserSpaceToImageSpace,
const gfxRect& aSourceRect,
const gfxRect& aSubimage,
@@ -254,16 +255,17 @@ CreateSamplingRestrictedDrawable(gfxDraw
tmpCtx->SetOperator(OptimalFillOperator());
aDrawable->Draw(tmpCtx, needed - needed.TopLeft(), true,
gfxPattern::FILTER_FAST, gfxMatrix().Translate(needed.TopLeft()));
nsRefPtr<gfxDrawable> drawable =
new gfxSurfaceDrawable(temp, size, gfxMatrix().Translate(-needed.TopLeft()));
return drawable.forget();
}
+#endif // !MOZ_GFX_OPTIMIZE_MOBILE
// working around cairo/pixman bug (bug 364968)
// Our device-space-to-image-space transform may not be acceptable to pixman.
struct NS_STACK_CLASS AutoCairoPixmanBugWorkaround
{
AutoCairoPixmanBugWorkaround(gfxContext* aContext,
const gfxMatrix& aDeviceSpaceToImageSpace,
const gfxRect& aFill,