Add a fixed-width font for the compositor's debug overlay. (bug 1352151 part 9, r=bas)

--HG--
extra : rebase_source : dc65a2bfb0bb166b5f116f04e2b5ecc395578ba5
This commit is contained in:
David Anderson 2017-04-10 19:44:47 -07:00
parent 3ffc9da44f
commit fc959f3460
4 changed files with 42 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -638,8 +638,9 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
text,
IntPoint(2, 5),
Matrix4x4(),
30,
650);
24,
600,
TextRenderer::FontType::FixedWidth);
if (mUnusedApzTransformWarning) {
// If we have an unused APZ transform on this composite, draw a 20x20 red box

View File

@ -5,6 +5,7 @@
#include "TextRenderer.h"
#include "FontData.h"
#include "ConsolasFontData.h"
#include "png.h"
#include "mozilla/Base64.h"
#include "mozilla/layers/Compositor.h"
@ -186,9 +187,11 @@ TextRenderer::GetFontInfo(FontType aType)
switch (aType) {
case FontType::Default:
return &sDefaultCompositorFont;
break;
case FontType::FixedWidth:
return &sFixedWidthCompositorFont;
default:
MOZ_ASSERT_UNREACHABLE("unknown font type");
return nullptr;
}
}

View File

@ -28,6 +28,7 @@ public:
enum class FontType {
Default,
FixedWidth,
NumTypes
};