GrSemaphoreOp.h 973 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright 2017 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 GrSemaphoreOp_DEFINED
  8. #define GrSemaphoreOp_DEFINED
  9. #include "src/gpu/ops/GrOp.h"
  10. #include "include/core/SkRefCnt.h"
  11. #include "src/gpu/GrRenderTargetProxy.h"
  12. #include "src/gpu/GrSemaphore.h"
  13. class GrRecordingContext;
  14. class GrSemaphoreOp : public GrOp {
  15. public:
  16. static std::unique_ptr<GrOp> MakeWait(GrRecordingContext*,
  17. sk_sp<GrSemaphore>,
  18. GrRenderTargetProxy*);
  19. protected:
  20. GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy)
  21. : INHERITED(classId)
  22. , fSemaphore(std::move(semaphore)) {
  23. this->makeFullScreen(proxy);
  24. }
  25. sk_sp<GrSemaphore> fSemaphore;
  26. private:
  27. void onPrepare(GrOpFlushState*) override {}
  28. typedef GrOp INHERITED;
  29. };
  30. #endif