blob: 35fcce5b1335779789df038898b44ccb43b60505 [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
halcanary0cbe7ee2015-12-01 09:02:49 -080013#ifdef SK_BUILD_FOR_WIN
14
bungeman@google.com9df621d2011-06-23 21:43:52 +000015/**
16 * An instance of this class initializes COM on creation
17 * and closes the COM library on destruction.
18 */
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000019class SkAutoCoInitialize : SkNoncopyable {
bungeman@google.com9df621d2011-06-23 21:43:52 +000020private:
21 HRESULT fHR;
22public:
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000023 SkAutoCoInitialize();
24 ~SkAutoCoInitialize();
25 bool succeeded();
bungeman@google.com9df621d2011-06-23 21:43:52 +000026};
27
halcanary0cbe7ee2015-12-01 09:02:49 -080028#endif // SK_BUILD_FOR_WIN
29#endif // SkAutoCo_DEFINED