aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/win/SkAutoCoInitialize.h
blob: 17fb1f53617ffba0797d37f655f905c666006030 (plain)
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
/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkAutoCo_DEFINED
#define SkAutoCo_DEFINED

#include "SkTypes.h"

#ifdef SK_BUILD_FOR_WIN

#include "SkLeanWindows.h"
#include "SkNoncopyable.h"

/**
 * An instance of this class initializes COM on creation
 * and closes the COM library on destruction.
 */
class SkAutoCoInitialize : SkNoncopyable {
private:
    HRESULT fHR;
public:
    SkAutoCoInitialize();
    ~SkAutoCoInitialize();
    bool succeeded();
};

#endif  // SK_BUILD_FOR_WIN
#endif  // SkAutoCo_DEFINED