Robert Phillips | cb2e235 | 2017-08-30 16:44:40 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 "GrGLGpuCommandBuffer.h" |
| 9 | |
| 10 | #include "GrFixedClip.h" |
| 11 | #include "GrRenderTargetPriv.h" |
| 12 | |
| 13 | void GrGLGpuRTCommandBuffer::begin() { |
| 14 | if (GrLoadOp::kClear == fColorLoadAndStoreInfo.fLoadOp) { |
| 15 | fGpu->clear(GrFixedClip::Disabled(), fColorLoadAndStoreInfo.fClearColor, |
| 16 | fRenderTarget, fOrigin); |
| 17 | } |
| 18 | if (GrLoadOp::kClear == fStencilLoadAndStoreInfo.fLoadOp) { |
| 19 | GrStencilAttachment* sb = fRenderTarget->renderTargetPriv().getStencilAttachment(); |
| 20 | if (sb && (sb->isDirty() || fRenderTarget->alwaysClearStencil())) { |
| 21 | fGpu->clearStencil(fRenderTarget, 0x0); |
| 22 | } |
| 23 | } |
| 24 | } |