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