gfx/thebes/gfxFontMissingGlyphs.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_FONTMISSINGGLYPHS_H
     7 #define GFX_FONTMISSINGGLYPHS_H
     9 #include "gfxTypes.h"
    10 #include "gfxRect.h"
    12 class gfxContext;
    14 /**
    15  * This class should not be instantiated. It's just a container
    16  * for some helper functions.
    17  */
    18 class gfxFontMissingGlyphs {
    19 public:
    20     /**
    21      * Draw hexboxes for a missing glyph.
    22      * @param aContext the context to draw to
    23      * @param aRect the glyph-box for the glyph that is missing
    24      * @param aChar the UTF16 codepoint for the character
    25      * @param aAppUnitsPerDevPixel the appUnits to devPixel ratio we're using,
    26      *                             (so we can scale glyphs to a sensible size)
    27      */
    28     static void DrawMissingGlyph(gfxContext    *aContext,
    29                                  const gfxRect& aRect,
    30                                  uint32_t       aChar,
    31                                  uint32_t       aAppUnitsPerDevPixel);
    32     /**
    33      * @return the desired minimum width for a glyph-box that will allow
    34      * the hexboxes to be drawn reasonably.
    35      */
    36     static gfxFloat GetDesiredMinWidth(uint32_t aChar,
    37                                        uint32_t aAppUnitsPerDevUnit);
    38 };
    40 #endif

mercurial