This file is indexed.

/usr/include/thunderbird/gfx2DGlue.h is in thunderbird-dev 1:38.6.0+build1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_2D_GLUE_H
#define GFX_2D_GLUE_H


#include "gfxPlatform.h"
#include "gfxRect.h"
#include "gfxMatrix.h"
#include "gfx3DMatrix.h"
#include "gfxContext.h"
#include "mozilla/gfx/Matrix.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/gfx/2D.h"
#include "gfxColor.h"

namespace mozilla {
namespace gfx {
class DrawTarget;
class SourceSurface;
class ScaledFont;
}
}

namespace mozilla {
namespace gfx {

inline Rect ToRect(const gfxRect &aRect)
{
  return Rect(Float(aRect.x), Float(aRect.y),
              Float(aRect.width), Float(aRect.height));
}

inline Rect ToRect(const nsIntRect &aRect)
{
  return Rect(aRect.x, aRect.y, aRect.width, aRect.height);
}

inline IntRect ToIntRect(const nsIntRect &aRect)
{
  return IntRect(aRect.x, aRect.y, aRect.width, aRect.height);
}

inline Color ToColor(const gfxRGBA &aRGBA)
{
  return Color(Float(aRGBA.r), Float(aRGBA.g),
               Float(aRGBA.b), Float(aRGBA.a));
}

inline gfxRGBA ThebesColor(Color &aColor)
{
  return gfxRGBA(aColor.r, aColor.g, aColor.b, aColor.a);
}

inline Matrix ToMatrix(const gfxMatrix &aMatrix)
{
  return Matrix(Float(aMatrix._11), Float(aMatrix._12), Float(aMatrix._21),
                Float(aMatrix._22), Float(aMatrix._31), Float(aMatrix._32));
}

inline gfxMatrix ThebesMatrix(const Matrix &aMatrix)
{
  return gfxMatrix(aMatrix._11, aMatrix._12, aMatrix._21,
                   aMatrix._22, aMatrix._31, aMatrix._32);
}

inline Point ToPoint(const gfxPoint &aPoint)
{
  return Point(Float(aPoint.x), Float(aPoint.y));
}

inline IntPoint ToIntPoint(const nsIntPoint &aPoint)
{
  return IntPoint(aPoint.x, aPoint.y);
}

inline Size ToSize(const gfxSize &aSize)
{
  return Size(Float(aSize.width), Float(aSize.height));
}

inline IntSize ToIntSize(const gfxIntSize &aSize)
{
  return IntSize(aSize.width, aSize.height);
}

inline Filter ToFilter(GraphicsFilter aFilter)
{
  switch (aFilter) {
  case GraphicsFilter::FILTER_NEAREST:
    return Filter::POINT;
  case GraphicsFilter::FILTER_GOOD:
    return Filter::GOOD;
  default:
    return Filter::LINEAR;
  }
}

inline GraphicsFilter ThebesFilter(Filter aFilter)
{
  switch (aFilter) {
  case Filter::POINT:
    return GraphicsFilter::FILTER_NEAREST;
  default:
    return GraphicsFilter::FILTER_BEST;
  }
}

inline ExtendMode ToExtendMode(gfxPattern::GraphicsExtend aExtend)
{
  switch (aExtend) {
  case gfxPattern::EXTEND_REPEAT:
    return ExtendMode::REPEAT;
  case gfxPattern::EXTEND_REFLECT:
    return ExtendMode::REFLECT;
  default:
    return ExtendMode::CLAMP;
  }
}

inline gfxPattern::GraphicsPatternType
ThebesPatternType(PatternType aType)
{
  switch (aType) {
  case PatternType::SURFACE:
    return gfxPattern::PATTERN_SURFACE;
  case PatternType::LINEAR_GRADIENT:
    return gfxPattern::PATTERN_LINEAR;
  case PatternType::RADIAL_GRADIENT:
    return gfxPattern::PATTERN_RADIAL;
  default:
    return gfxPattern::PATTERN_SOLID;
  }
}

inline gfxPattern::GraphicsExtend ThebesExtend(ExtendMode aExtend)
{
  switch (aExtend) {
  case ExtendMode::REPEAT:
    return gfxPattern::EXTEND_REPEAT;
  case ExtendMode::REFLECT:
    return gfxPattern::EXTEND_REFLECT;
  default:
    return gfxPattern::EXTEND_PAD;
  }
}

inline gfxPoint ThebesPoint(const Point &aPoint)
{
  return gfxPoint(aPoint.x, aPoint.y);
}

inline gfxSize ThebesSize(const Size &aSize)
{
  return gfxSize(aSize.width, aSize.height);
}

inline gfxIntSize ThebesIntSize(const IntSize &aSize)
{
  return gfxIntSize(aSize.width, aSize.height);
}

inline gfxRect ThebesRect(const Rect &aRect)
{
  return gfxRect(aRect.x, aRect.y, aRect.width, aRect.height);
}

inline nsIntRect ThebesIntRect(const IntRect &aRect)
{
  return nsIntRect(aRect.x, aRect.y, aRect.width, aRect.height);
}

inline gfxRGBA ThebesRGBA(const Color &aColor)
{
  return gfxRGBA(aColor.r, aColor.g, aColor.b, aColor.a);
}

inline gfxImageFormat SurfaceFormatToImageFormat(SurfaceFormat aFormat)
{
  switch (aFormat) {
  case SurfaceFormat::B8G8R8A8:
    return gfxImageFormat::ARGB32;
  case SurfaceFormat::B8G8R8X8:
    return gfxImageFormat::RGB24;
  case SurfaceFormat::R5G6B5:
    return gfxImageFormat::RGB16_565;
  case SurfaceFormat::A8:
    return gfxImageFormat::A8;
  default:
    return gfxImageFormat::Unknown;
  }
}

inline SurfaceFormat ImageFormatToSurfaceFormat(gfxImageFormat aFormat)
{
  switch (aFormat) {
  case gfxImageFormat::ARGB32:
    return SurfaceFormat::B8G8R8A8;
  case gfxImageFormat::RGB24:
    return SurfaceFormat::B8G8R8X8;
  case gfxImageFormat::RGB16_565:
    return SurfaceFormat::R5G6B5;
  case gfxImageFormat::A8:
    return SurfaceFormat::A8;
  default:
  case gfxImageFormat::Unknown:
    return SurfaceFormat::B8G8R8A8;
  }
}

inline gfxContentType ContentForFormat(const SurfaceFormat &aFormat)
{
  switch (aFormat) {
  case SurfaceFormat::R5G6B5:
  case SurfaceFormat::B8G8R8X8:
  case SurfaceFormat::R8G8B8X8:
    return gfxContentType::COLOR;
  case SurfaceFormat::A8:
    return gfxContentType::ALPHA;
  case SurfaceFormat::B8G8R8A8:
  case SurfaceFormat::R8G8B8A8:
  default:
    return gfxContentType::COLOR_ALPHA;
  }
}

inline CompositionOp CompositionOpForOp(gfxContext::GraphicsOperator aOp)
{
  switch (aOp) {
  case gfxContext::OPERATOR_ADD:
    return CompositionOp::OP_ADD;
  case gfxContext::OPERATOR_ATOP:
    return CompositionOp::OP_ATOP;
  case gfxContext::OPERATOR_IN:
    return CompositionOp::OP_IN;
  case gfxContext::OPERATOR_OUT:
    return CompositionOp::OP_OUT;
  case gfxContext::OPERATOR_SOURCE:
    return CompositionOp::OP_SOURCE;
  case gfxContext::OPERATOR_DEST_IN:
    return CompositionOp::OP_DEST_IN;
  case gfxContext::OPERATOR_DEST_OUT:
    return CompositionOp::OP_DEST_OUT;
  case gfxContext::OPERATOR_DEST_ATOP:
    return CompositionOp::OP_DEST_ATOP;
  case gfxContext::OPERATOR_XOR:
    return CompositionOp::OP_XOR;
  case gfxContext::OPERATOR_MULTIPLY:
    return CompositionOp::OP_MULTIPLY;
  case gfxContext::OPERATOR_SCREEN:
    return CompositionOp::OP_SCREEN;
  case gfxContext::OPERATOR_OVERLAY:
    return CompositionOp::OP_OVERLAY;
  case gfxContext::OPERATOR_DARKEN:
    return CompositionOp::OP_DARKEN;
  case gfxContext::OPERATOR_LIGHTEN:
    return CompositionOp::OP_LIGHTEN;
  case gfxContext::OPERATOR_COLOR_DODGE:
    return CompositionOp::OP_COLOR_DODGE;
  case gfxContext::OPERATOR_COLOR_BURN:
    return CompositionOp::OP_COLOR_BURN;
  case gfxContext::OPERATOR_HARD_LIGHT:
    return CompositionOp::OP_HARD_LIGHT;
  case gfxContext::OPERATOR_SOFT_LIGHT:
    return CompositionOp::OP_SOFT_LIGHT;
  case gfxContext::OPERATOR_DIFFERENCE:
    return CompositionOp::OP_DIFFERENCE;
  case gfxContext::OPERATOR_EXCLUSION:
    return CompositionOp::OP_EXCLUSION;
  case gfxContext::OPERATOR_HUE:
    return CompositionOp::OP_HUE;
  case gfxContext::OPERATOR_SATURATION:
    return CompositionOp::OP_SATURATION;
  case gfxContext::OPERATOR_COLOR:
    return CompositionOp::OP_COLOR;
  case gfxContext::OPERATOR_LUMINOSITY:
    return CompositionOp::OP_LUMINOSITY;
  default:
    return CompositionOp::OP_OVER;
  }
}

inline gfxContext::GraphicsOperator ThebesOp(CompositionOp aOp)
{
  switch (aOp) {
  case CompositionOp::OP_ADD:
    return gfxContext::OPERATOR_ADD;
  case CompositionOp::OP_ATOP:
    return gfxContext::OPERATOR_ATOP;
  case CompositionOp::OP_IN:
    return gfxContext::OPERATOR_IN;
  case CompositionOp::OP_OUT:
    return gfxContext::OPERATOR_OUT;
  case CompositionOp::OP_SOURCE:
    return gfxContext::OPERATOR_SOURCE;
  case CompositionOp::OP_DEST_IN:
    return gfxContext::OPERATOR_DEST_IN;
  case CompositionOp::OP_DEST_OUT:
    return gfxContext::OPERATOR_DEST_OUT;
  case CompositionOp::OP_DEST_ATOP:
    return gfxContext::OPERATOR_DEST_ATOP;
  case CompositionOp::OP_XOR:
    return gfxContext::OPERATOR_XOR;
  case CompositionOp::OP_MULTIPLY:
    return gfxContext::OPERATOR_MULTIPLY;
  case CompositionOp::OP_SCREEN:
    return gfxContext::OPERATOR_SCREEN;
  case CompositionOp::OP_OVERLAY:
    return gfxContext::OPERATOR_OVERLAY;
  case CompositionOp::OP_DARKEN:
    return gfxContext::OPERATOR_DARKEN;
  case CompositionOp::OP_LIGHTEN:
    return gfxContext::OPERATOR_LIGHTEN;
  case CompositionOp::OP_COLOR_DODGE:
    return gfxContext::OPERATOR_COLOR_DODGE;
  case CompositionOp::OP_COLOR_BURN:
    return gfxContext::OPERATOR_COLOR_BURN;
  case CompositionOp::OP_HARD_LIGHT:
    return gfxContext::OPERATOR_HARD_LIGHT;
  case CompositionOp::OP_SOFT_LIGHT:
    return gfxContext::OPERATOR_SOFT_LIGHT;
  case CompositionOp::OP_DIFFERENCE:
    return gfxContext::OPERATOR_DIFFERENCE;
  case CompositionOp::OP_EXCLUSION:
    return gfxContext::OPERATOR_EXCLUSION;
  case CompositionOp::OP_HUE:
    return gfxContext::OPERATOR_HUE;
  case CompositionOp::OP_SATURATION:
    return gfxContext::OPERATOR_SATURATION;
  case CompositionOp::OP_COLOR:
    return gfxContext::OPERATOR_COLOR;
  case CompositionOp::OP_LUMINOSITY:
    return gfxContext::OPERATOR_LUMINOSITY;
  default:
    return gfxContext::OPERATOR_OVER;
  }
}

inline Matrix4x4
ToMatrix4x4(const gfx3DMatrix& aIn)
{
  Matrix4x4 m;
  m._11 = aIn._11;
  m._12 = aIn._12;
  m._13 = aIn._13;
  m._14 = aIn._14;
  m._21 = aIn._21;
  m._22 = aIn._22;
  m._23 = aIn._23;
  m._24 = aIn._24;
  m._31 = aIn._31;
  m._32 = aIn._32;
  m._33 = aIn._33;
  m._34 = aIn._34;
  m._41 = aIn._41;
  m._42 = aIn._42;
  m._43 = aIn._43;
  m._44 = aIn._44;
  return m;
}

inline gfx3DMatrix
To3DMatrix(const Matrix4x4& aIn)
{
  gfx3DMatrix m;
  m._11 = aIn._11;
  m._12 = aIn._12;
  m._13 = aIn._13;
  m._14 = aIn._14;
  m._21 = aIn._21;
  m._22 = aIn._22;
  m._23 = aIn._23;
  m._24 = aIn._24;
  m._31 = aIn._31;
  m._32 = aIn._32;
  m._33 = aIn._33;
  m._34 = aIn._34;
  m._41 = aIn._41;
  m._42 = aIn._42;
  m._43 = aIn._43;
  m._44 = aIn._44;
  return m;
}

}
}

#endif