aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrClearStencilClipOp.cpp
blob: 64985b707d894c82ac5658ac97e6d265e58c4fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrClearStencilClipOp.h"

#include "GrGpuCommandBuffer.h"
#include "GrMemoryPool.h"

std::unique_ptr<GrOp> GrClearStencilClipOp::Make(GrContext* context,
                                                 const GrFixedClip& clip,
                                                 bool insideStencilMask,
                                                 GrRenderTargetProxy* proxy) {
    GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();

    return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy);
}

void GrClearStencilClipOp::onExecute(GrOpFlushState* state) {
    SkASSERT(state->rtCommandBuffer());
    state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask);
}