Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/widget/gtk/nsImageToPixbuf.h
Line
Count
Source (jump to first uncovered line)
1
/* vim:set sw=4 sts=4 et cin: */
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/. */
5
6
#ifndef NSIMAGETOPIXBUF_H_
7
#define NSIMAGETOPIXBUF_H_
8
9
#include "nsIImageToPixbuf.h"
10
#include "mozilla/Attributes.h"
11
12
namespace mozilla {
13
namespace gfx {
14
class SourceSurface;
15
}
16
}
17
18
class nsImageToPixbuf final : public nsIImageToPixbuf {
19
    typedef mozilla::gfx::SourceSurface SourceSurface;
20
21
    public:
22
        NS_DECL_ISUPPORTS
23
        NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage) override;
24
25
        // Friendlier version of ConvertImageToPixbuf for callers inside of
26
        // widget
27
        /**
28
         * The return value of all these, if not null, should be
29
         * released as needed by the caller using g_object_unref.
30
         */
31
        static GdkPixbuf* ImageToPixbuf(imgIContainer * aImage);
32
        static GdkPixbuf* SourceSurfaceToPixbuf(SourceSurface* aSurface,
33
                                                int32_t aWidth,
34
                                                int32_t aHeight);
35
36
    private:
37
0
        ~nsImageToPixbuf() {}
38
};
39
40
41
// fc2389b8-c650-4093-9e42-b05e5f0685b7
42
#define NS_IMAGE_TO_PIXBUF_CID \
43
{ 0xfc2389b8, 0xc650, 0x4093, \
44
  { 0x9e, 0x42, 0xb0, 0x5e, 0x5f, 0x06, 0x85, 0xb7 } }
45
46
#endif