blob: 1123002b61627bce864593055b2b78b5128900ef [file] [log] [blame]
bungeman@google.com9df621d2011-06-23 21:43:52 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
bungeman@google.com9df621d2011-06-23 21:43:52 +00006 */
7
bungeman@google.com9df621d2011-06-23 21:43:52 +00008#ifndef SkAutoCo_DEFINED
9#define SkAutoCo_DEFINED
10
bungemanf3c15b72015-08-19 11:56:48 -070011#include "SkTypes.h"
bungeman@google.com9df621d2011-06-23 21:43:52 +000012
13/**
14 * An instance of this class initializes COM on creation
15 * and closes the COM library on destruction.
16 */
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000017class SkAutoCoInitialize : SkNoncopyable {
bungeman@google.com9df621d2011-06-23 21:43:52 +000018private:
19 HRESULT fHR;
20public:
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000021 SkAutoCoInitialize();
22 ~SkAutoCoInitialize();
23 bool succeeded();
bungeman@google.com9df621d2011-06-23 21:43:52 +000024};
25
26#endif