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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 15 | #include "include/private/SkNoncopyable.h" |
Ben Wagner | ab6eefe | 2019-05-20 11:02:49 -0400 | [diff] [blame] | 16 | #include "src/core/SkLeanWindows.h" |
halcanary | 4dbbd04 | 2016-06-07 17:21:10 -0700 | [diff] [blame] | 17 | |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 18 | /** |
| 19 | * An instance of this class initializes COM on creation |
| 20 | * and closes the COM library on destruction. |
| 21 | */ |
bungeman@google.com | 2e2f3f5 | 2011-09-16 15:37:20 +0000 | [diff] [blame] | 22 | class SkAutoCoInitialize : SkNoncopyable { |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 23 | private: |
| 24 | HRESULT fHR; |
| 25 | public: |
bungeman@google.com | 2e2f3f5 | 2011-09-16 15:37:20 +0000 | [diff] [blame] | 26 | SkAutoCoInitialize(); |
| 27 | ~SkAutoCoInitialize(); |
| 28 | bool succeeded(); |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
halcanary | 0cbe7ee | 2015-12-01 09:02:49 -0800 | [diff] [blame] | 31 | #endif // SK_BUILD_FOR_WIN |
| 32 | #endif // SkAutoCo_DEFINED |