• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
Make(GrContext * context,const GrFixedClip & clip,bool insideStencilMask,GrRenderTargetProxy * proxy)13 std::unique_ptr<GrOp> GrClearStencilClipOp::Make(GrContext* context,
14                                                  const GrFixedClip& clip,
15                                                  bool insideStencilMask,
16                                                  GrRenderTargetProxy* proxy) {
17     GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
18 
19     return pool->allocate<GrClearStencilClipOp>(clip, insideStencilMask, proxy);
20 }
21 
onExecute(GrOpFlushState * state,const SkRect & chainBounds)22 void GrClearStencilClipOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
23     SkASSERT(state->rtCommandBuffer());
24     state->rtCommandBuffer()->clearStencilClip(fClip, fInsideStencilMask);
25 }
26