| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkAutoCo_DEFINED | 8 #ifndef SkAutoCo_DEFINED |
| 9 #define SkAutoCo_DEFINED | 9 #define SkAutoCo_DEFINED |
| 10 | 10 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 | 12 |
| 13 #ifdef SK_BUILD_FOR_WIN | 13 #ifdef SK_BUILD_FOR_WIN |
| 14 | 14 |
| 15 #include "../../private/SkLeanWindows.h" |
| 16 |
| 15 /** | 17 /** |
| 16 * An instance of this class initializes COM on creation | 18 * An instance of this class initializes COM on creation |
| 17 * and closes the COM library on destruction. | 19 * and closes the COM library on destruction. |
| 18 */ | 20 */ |
| 19 class SkAutoCoInitialize : SkNoncopyable { | 21 class SkAutoCoInitialize : SkNoncopyable { |
| 20 private: | 22 private: |
| 21 HRESULT fHR; | 23 HRESULT fHR; |
| 22 public: | 24 public: |
| 23 SkAutoCoInitialize(); | 25 SkAutoCoInitialize(); |
| 24 ~SkAutoCoInitialize(); | 26 ~SkAutoCoInitialize(); |
| 25 bool succeeded(); | 27 bool succeeded(); |
| 26 }; | 28 }; |
| 27 | 29 |
| 28 #endif // SK_BUILD_FOR_WIN | 30 #endif // SK_BUILD_FOR_WIN |
| 29 #endif // SkAutoCo_DEFINED | 31 #endif // SkAutoCo_DEFINED |
| OLD | NEW |