2 * Copyright 2019 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "src/gpu/ganesh/GrProgramInfo.h"
10 #include "src/gpu/ganesh/GrStencilSettings.h"
11 #include "src/gpu/ganesh/effects/GrTextureEffect.h"
13 GrStencilSettings GrProgramInfo::nonGLStencilSettings() const {
14 GrStencilSettings stencil;
16 if (this->isStencilEnabled()) {
17 stencil.reset(*fUserStencilSettings, this->pipeline().hasStencilClip(), 8);
24 #include "src/gpu/ganesh/GrTexture.h"
26 void GrProgramInfo::validate(bool flushTime) const {
28 SkASSERT(fPipeline->allProxiesInstantiated());
32 void GrProgramInfo::checkAllInstantiated() const {
33 this->pipeline().visitProxies([](GrSurfaceProxy* proxy, GrMipmapped) {
34 SkASSERT(proxy->isInstantiated());
39 void GrProgramInfo::checkMSAAAndMIPSAreResolved() const {
40 this->pipeline().visitTextureEffects([](const GrTextureEffect& te) {
41 GrTexture* tex = te.texture();
44 // Ensure mipmaps were all resolved ahead of time by the DAG.
45 if (te.samplerState().mipmapped() == GrMipmapped::kYes &&
46 (tex->width() != 1 || tex->height() != 1)) {
47 // There are some cases where we might be given a non-mipmapped texture with a
48 // mipmap filter. See skbug.com/7094.
49 SkASSERT(tex->mipmapped() != GrMipmapped::kYes || !tex->mipmapsAreDirty());