blob: 99cfd5faf9c2d9b8a3a0be230a83e5be3be1d415 [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 Phillips9da87e02019-02-04 13:26:26 -050017 GrOpMemoryPool* pool = context->priv().opMemoryPool();
Robert Phillipsc994a932018-06-19 13:09:54 -040018
19 return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy);
Robert Phillips7c525e62018-06-12 10:11:12 -040020}
21
Brian Salomon588cec72018-11-14 13:56:37 -050022void GrClearStencilClipOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
Robert Phillips7c525e62018-06-12 10:11:12 -040023 SkASSERT(state->rtCommandBuffer());
24 state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask);
25}