GrClearStencilClipOp.cpp 1.0 KB

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright 2018 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 "src/gpu/ops/GrClearStencilClipOp.h"
  8. #include "include/private/GrRecordingContext.h"
  9. #include "src/gpu/GrGpuCommandBuffer.h"
  10. #include "src/gpu/GrMemoryPool.h"
  11. #include "src/gpu/GrOpFlushState.h"
  12. #include "src/gpu/GrRecordingContextPriv.h"
  13. std::unique_ptr<GrOp> GrClearStencilClipOp::Make(GrRecordingContext* context,
  14. const GrFixedClip& clip,
  15. bool insideStencilMask,
  16. GrRenderTargetProxy* proxy) {
  17. GrOpMemoryPool* pool = context->priv().opMemoryPool();
  18. return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy);
  19. }
  20. void GrClearStencilClipOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
  21. SkASSERT(state->rtCommandBuffer());
  22. state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask);
  23. }