gfx/thebes/gfxTypes.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.

michael@0 1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef GFX_TYPES_H
michael@0 7 #define GFX_TYPES_H
michael@0 8
michael@0 9 #include <stdint.h>
michael@0 10 #include "mozilla/TypedEnum.h"
michael@0 11
michael@0 12 typedef struct _cairo_surface cairo_surface_t;
michael@0 13 typedef struct _cairo_user_data_key cairo_user_data_key_t;
michael@0 14
michael@0 15 typedef void (*thebes_destroy_func_t) (void *data);
michael@0 16
michael@0 17 /**
michael@0 18 * Currently needs to be 'double' for Cairo compatibility. Could
michael@0 19 * become 'float', perhaps, in some configurations.
michael@0 20 */
michael@0 21 typedef double gfxFloat;
michael@0 22
michael@0 23 /**
michael@0 24 * Priority of a line break opportunity.
michael@0 25 *
michael@0 26 * eNoBreak The line has no break opportunities
michael@0 27 * eWordWrapBreak The line has a break opportunity only within a word. With
michael@0 28 * word-wrap: break-word we will break at this point only if
michael@0 29 * there are no other break opportunities in the line.
michael@0 30 * eNormalBreak The line has a break opportunity determined by the standard
michael@0 31 * line-breaking algorithm.
michael@0 32 *
michael@0 33 * Future expansion: split eNormalBreak into multiple priorities, e.g.
michael@0 34 * punctuation break and whitespace break (bug 389710).
michael@0 35 * As and when we implement it, text-wrap: unrestricted will
michael@0 36 * mean that priorities are ignored and all line-break
michael@0 37 * opportunities are equal.
michael@0 38 *
michael@0 39 * @see gfxTextRun::BreakAndMeasureText
michael@0 40 * @see nsLineLayout::NotifyOptionalBreakPosition
michael@0 41 */
michael@0 42 MOZ_BEGIN_ENUM_CLASS(gfxBreakPriority)
michael@0 43 eNoBreak = 0,
michael@0 44 eWordWrapBreak,
michael@0 45 eNormalBreak
michael@0 46 MOZ_END_ENUM_CLASS(gfxBreakPriority)
michael@0 47
michael@0 48 /**
michael@0 49 * The format for an image surface. For all formats with alpha data, 0
michael@0 50 * means transparent, 1 or 255 means fully opaque.
michael@0 51 */
michael@0 52 MOZ_BEGIN_ENUM_CLASS(gfxImageFormat)
michael@0 53 ARGB32, ///< ARGB data in native endianness, using premultiplied alpha
michael@0 54 RGB24, ///< xRGB data in native endianness
michael@0 55 A8, ///< Only an alpha channel
michael@0 56 A1, ///< Packed transparency information (one byte refers to 8 pixels)
michael@0 57 RGB16_565, ///< RGB_565 data in native endianness
michael@0 58 Unknown
michael@0 59 MOZ_END_ENUM_CLASS(gfxImageFormat)
michael@0 60
michael@0 61 MOZ_BEGIN_ENUM_CLASS(gfxSurfaceType)
michael@0 62 Image,
michael@0 63 PDF,
michael@0 64 PS,
michael@0 65 Xlib,
michael@0 66 Xcb,
michael@0 67 Glitz, // unused, but needed for cairo parity
michael@0 68 Quartz,
michael@0 69 Win32,
michael@0 70 BeOS,
michael@0 71 DirectFB, // unused, but needed for cairo parity
michael@0 72 SVG,
michael@0 73 OS2,
michael@0 74 Win32Printing,
michael@0 75 QuartzImage,
michael@0 76 Script,
michael@0 77 QPainter,
michael@0 78 Recording,
michael@0 79 VG,
michael@0 80 GL,
michael@0 81 DRM,
michael@0 82 Tee,
michael@0 83 XML,
michael@0 84 Skia,
michael@0 85 Subsurface,
michael@0 86 D2D,
michael@0 87 Max
michael@0 88 MOZ_END_ENUM_CLASS(gfxSurfaceType)
michael@0 89
michael@0 90 MOZ_BEGIN_ENUM_CLASS(gfxContentType)
michael@0 91 COLOR = 0x1000,
michael@0 92 ALPHA = 0x2000,
michael@0 93 COLOR_ALPHA = 0x3000,
michael@0 94 SENTINEL = 0xffff
michael@0 95 MOZ_END_ENUM_CLASS(gfxContentType)
michael@0 96
michael@0 97 /**
michael@0 98 * The memory used by a gfxASurface (as reported by KnownMemoryUsed()) can
michael@0 99 * either live in this process's heap, in this process but outside the
michael@0 100 * heap, or in another process altogether.
michael@0 101 */
michael@0 102 MOZ_BEGIN_ENUM_CLASS(gfxMemoryLocation)
michael@0 103 IN_PROCESS_HEAP,
michael@0 104 IN_PROCESS_NONHEAP,
michael@0 105 OUT_OF_PROCESS
michael@0 106 MOZ_END_ENUM_CLASS(gfxMemoryLocation)
michael@0 107
michael@0 108 #endif /* GFX_TYPES_H */

mercurial