Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 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 "GrClearStencilClipOp.h" |
| 9 | |
| 10 | #include "GrGpuCommandBuffer.h" |
| 11 | #include "GrMemoryPool.h" |
| 12 | |
| 13 | std::unique_ptr<GrOp> GrClearStencilClipOp::Make(GrContext* context, |
| 14 | const GrFixedClip& clip, |
| 15 | bool insideStencilMask, |
| 16 | GrRenderTargetProxy* proxy) { |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 17 | GrOpMemoryPool* pool = context->priv().opMemoryPool(); |
Robert Phillips | c994a93 | 2018-06-19 13:09:54 -0400 | [diff] [blame] | 18 | |
| 19 | return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy); |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 20 | } |
| 21 | |
Brian Salomon | 588cec7 | 2018-11-14 13:56:37 -0500 | [diff] [blame] | 22 | void GrClearStencilClipOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) { |
Robert Phillips | 7c525e6 | 2018-06-12 10:11:12 -0400 | [diff] [blame] | 23 | SkASSERT(state->rtCommandBuffer()); |
| 24 | state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask); |
| 25 | } |