bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * 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.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 8 | #ifndef SkAutoCo_DEFINED |
| 9 | #define SkAutoCo_DEFINED |
| 10 | |
bungeman | f3c15b7 | 2015-08-19 11:56:48 -0700 | [diff] [blame] | 11 | #include "SkTypes.h" |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 12 | |
halcanary | 0cbe7ee | 2015-12-01 09:02:49 -0800 | [diff] [blame^] | 13 | #ifdef SK_BUILD_FOR_WIN |
| 14 | |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 15 | /** |
| 16 | * An instance of this class initializes COM on creation |
| 17 | * and closes the COM library on destruction. |
| 18 | */ |
bungeman@google.com | 2e2f3f5 | 2011-09-16 15:37:20 +0000 | [diff] [blame] | 19 | class SkAutoCoInitialize : SkNoncopyable { |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 20 | private: |
| 21 | HRESULT fHR; |
| 22 | public: |
bungeman@google.com | 2e2f3f5 | 2011-09-16 15:37:20 +0000 | [diff] [blame] | 23 | SkAutoCoInitialize(); |
| 24 | ~SkAutoCoInitialize(); |
| 25 | bool succeeded(); |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
halcanary | 0cbe7ee | 2015-12-01 09:02:49 -0800 | [diff] [blame^] | 28 | #endif // SK_BUILD_FOR_WIN |
| 29 | #endif // SkAutoCo_DEFINED |