blob: 64985b707d894c82ac5658ac97e6d265e58c4fb9 [file] [log] [blame]
Robert Phillips7c525e62018-06-12 10:11:12 -04001/*
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 "GrClearStencilClipOp.h"
9
10#include "GrGpuCommandBuffer.h"
11#include "GrMemoryPool.h"
12
13std::unique_ptr<GrOp> GrClearStencilClipOp::Make(GrContext* context,
14 const GrFixedClip& clip,
15 bool insideStencilMask,
16 GrRenderTargetProxy* proxy) {
Robert Phillipsc994a932018-06-19 13:09:54 -040017 GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
18
19 return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy);
Robert Phillips7c525e62018-06-12 10:11:12 -040020}
21
22void GrClearStencilClipOp::onExecute(GrOpFlushState* state) {
23 SkASSERT(state->rtCommandBuffer());
24 state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask);
25}