GrImageContext.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2019 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. #include "include/private/GrImageContext.h"
  8. #include "src/gpu/GrCaps.h"
  9. #include "src/gpu/GrImageContextPriv.h"
  10. #include "src/gpu/GrProxyProvider.h"
  11. #include "src/gpu/GrSkSLFPFactoryCache.h"
  12. #define ASSERT_SINGLE_OWNER \
  13. SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());)
  14. ///////////////////////////////////////////////////////////////////////////////////////////////////
  15. GrImageContext::GrImageContext(GrBackendApi backend,
  16. const GrContextOptions& options,
  17. uint32_t contextID)
  18. : INHERITED(backend, options, contextID) {
  19. fProxyProvider.reset(new GrProxyProvider(this));
  20. }
  21. GrImageContext::~GrImageContext() {}
  22. void GrImageContext::abandonContext() {
  23. ASSERT_SINGLE_OWNER
  24. fAbandoned = true;
  25. }
  26. bool GrImageContext::abandoned() const {
  27. ASSERT_SINGLE_OWNER
  28. return fAbandoned;
  29. }
  30. ///////////////////////////////////////////////////////////////////////////////////////////////////
  31. sk_sp<const GrCaps> GrImageContextPriv::refCaps() const {
  32. return fContext->refCaps();
  33. }
  34. sk_sp<GrSkSLFPFactoryCache> GrImageContextPriv::fpFactoryCache() {
  35. return fContext->fpFactoryCache();
  36. }