зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337616 - Stop adding a new font key for every glyph array. r=jmuizelaar
This commit is contained in:
Родитель
f9c6425844
Коммит
78c642ecdc
|
@ -50,6 +50,7 @@ public:
|
|||
#endif
|
||||
virtual already_AddRefed<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
|
||||
virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton);
|
||||
virtual bool CanSerialize() override { return true; }
|
||||
|
||||
#ifdef USE_CAIRO_SCALED_FONT
|
||||
cairo_font_face_t* GetCairoFontFace();
|
||||
|
|
|
@ -359,13 +359,13 @@ WebRenderBridgeParent::ProcessWebrenderCommands(InfallibleTArray<WebRenderComman
|
|||
const OpDPPushText& op = cmd.get_OpDPPushText();
|
||||
const nsTArray<WrGlyphArray>& glyph_array = op.glyph_array();
|
||||
|
||||
// TODO: We are leaking the key
|
||||
wr::FontKey fontKey;
|
||||
auto slice = Range<uint8_t>(op.font_buffer().mData, op.font_buffer_length());
|
||||
fontKey = mApi->AddRawFont(slice);
|
||||
|
||||
for (size_t i = 0; i < glyph_array.Length(); i++) {
|
||||
const nsTArray<WrGlyphInstance>& glyphs = glyph_array[i].glyphs;
|
||||
|
||||
// TODO: We are leaking the key
|
||||
wr::FontKey fontKey;
|
||||
auto slice = Range<uint8_t>(op.font_buffer().mData, op.font_buffer_length());
|
||||
fontKey = mApi->AddRawFont(slice);
|
||||
builder.PushText(op.bounds(),
|
||||
op.clip(),
|
||||
glyph_array[i].color,
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace layers {
|
|||
using namespace mozilla::gfx;
|
||||
|
||||
static void
|
||||
DWriteFontFileData(const uint8_t* aData, uint32_t aLength, uint32_t aIndex,
|
||||
float aGlyphSize, uint32_t aVariationCount,
|
||||
const ScaledFont::VariationSetting* aVariations, void* aBaton)
|
||||
WriteFontFileData(const uint8_t* aData, uint32_t aLength, uint32_t aIndex,
|
||||
float aGlyphSize, uint32_t aVariationCount,
|
||||
const ScaledFont::VariationSetting* aVariations, void* aBaton)
|
||||
{
|
||||
WebRenderTextLayer* layer = static_cast<WebRenderTextLayer*>(aBaton);
|
||||
|
||||
|
@ -46,8 +46,9 @@ WebRenderTextLayer::RenderLayer()
|
|||
clip = rect;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mFont->GetType() == FontType::DWRITE);
|
||||
mFont->GetFontFileData(&DWriteFontFileData, this);
|
||||
MOZ_ASSERT((mFont->GetType() == FontType::DWRITE) ||
|
||||
(mFont->GetType() == FontType::MAC));
|
||||
mFont->GetFontFileData(&WriteFontFileData, this);
|
||||
wr::ByteBuffer fontBuffer(mFontDataLength, mFontData);
|
||||
|
||||
nsTArray<WrGlyphArray> wr_glyphs;
|
||||
|
|
Загрузка…
Ссылка в новой задаче