SkAutoCoInitialize.h 659 B

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