1 /* 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. 6 */ 7 8 #ifndef SkAutoCo_DEFINED 9 #define SkAutoCo_DEFINED 10 11 #include "include/core/SkTypes.h" 12 13 #ifdef SK_BUILD_FOR_WIN 14 15 #include "include/private/SkNoncopyable.h" 16 #include "src/core/SkLeanWindows.h" 17 18 /** 19 * An instance of this class initializes COM on creation 20 * and closes the COM library on destruction. 21 */ 22 class SkAutoCoInitialize : SkNoncopyable { 23 private: 24 HRESULT fHR; 25 public: 26 SkAutoCoInitialize(); 27 ~SkAutoCoInitialize(); 28 bool succeeded(); 29 }; 30 31 #endif // SK_BUILD_FOR_WIN 32 #endif // SkAutoCo_DEFINED 33