Remove GrTexturePriv

This existed because GrTexture used to be public.

Change-Id: I5e507084ae12058a20481b517b9130b41c793d29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305521
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2020-07-23 10:33:24 -04:00 committed by Skia Commit-Bot
parent 13e3faebc6
commit 4cfae3bc24
48 changed files with 145 additions and 232 deletions

View File

@ -238,7 +238,6 @@ skia_gpu_sources = [
"$_src/gpu/GrTextureAdjuster.h",
"$_src/gpu/GrTextureMaker.cpp",
"$_src/gpu/GrTextureMaker.h",
"$_src/gpu/GrTexturePriv.h",
"$_src/gpu/GrTextureProducer.cpp",
"$_src/gpu/GrTextureProducer.h",
"$_src/gpu/GrTextureProxy.cpp",

View File

@ -19,7 +19,6 @@
#include "src/gpu/GrResourceProviderPriv.h"
#include "src/gpu/GrSemaphore.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/gl/GrGLTexture.h"

View File

@ -30,7 +30,6 @@
#include "src/gpu/GrSurfaceContext.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/GrTextureResolveRenderTask.h"

View File

@ -31,7 +31,6 @@
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrStencilSettings.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/GrTracing.h"
#include "src/utils/SkJSONWriter.h"
@ -159,7 +158,7 @@ sk_sp<GrTexture> GrGpu::createTexture(SkISize dimensions,
auto tex = this->createTextureCommon(dimensions, format, renderable, renderTargetSampleCnt,
budgeted, isProtected, mipLevelCount, levelClearMask);
if (tex && mipMapped == GrMipmapped::kYes && levelClearMask) {
tex->texturePriv().markMipmapsClean();
tex->markMipmapsClean();
}
return tex;
}
@ -215,7 +214,7 @@ sk_sp<GrTexture> GrGpu::createTexture(SkISize dimensions,
markMipLevelsClean = true;
}
if (markMipLevelsClean) {
tex->texturePriv().markMipmapsClean();
tex->markMipmapsClean();
}
}
return tex;
@ -552,8 +551,8 @@ bool GrGpu::regenerateMipMapLevels(GrTexture* texture) {
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
SkASSERT(texture);
SkASSERT(this->caps()->mipmapSupport());
SkASSERT(texture->texturePriv().mipmapped() == GrMipmapped::kYes);
if (!texture->texturePriv().mipmapsAreDirty()) {
SkASSERT(texture->mipmapped() == GrMipmapped::kYes);
if (!texture->mipmapsAreDirty()) {
// This can happen when the proxy expects mipmaps to be dirty, but they are not dirty on the
// actual target. This may be caused by things that the drawingManager could not predict,
// i.e., ops that don't draw anything, aborting a draw for exceptional circumstances, etc.
@ -564,7 +563,7 @@ bool GrGpu::regenerateMipMapLevels(GrTexture* texture) {
return false;
}
if (this->onRegenerateMipMapLevels(texture)) {
texture->texturePriv().markMipmapsClean();
texture->markMipmapsClean();
return true;
}
return false;
@ -589,7 +588,7 @@ void GrGpu::didWriteToSurface(GrSurface* surface, GrSurfaceOrigin origin, const
if (nullptr == bounds || !bounds->isEmpty()) {
GrTexture* texture = surface->asTexture();
if (texture && 1 == mipLevels) {
texture->texturePriv().markMipmapsDirty();
texture->markMipmapsDirty();
}
}
}

View File

@ -17,7 +17,7 @@
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrScissorState.h"
#include "src/gpu/GrSimpleMesh.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
void GrOpsRenderPass::begin() {
fDrawPipelineStatus = DrawPipelineStatus::kNotConfigured;
@ -162,8 +162,7 @@ void GrOpsRenderPass::bindTextures(const GrPrimitiveProcessor& primProc,
(tex->width() != 1 || tex->height() != 1)) {
// There are some cases where we might be given a non-mipmapped texture with a mipmap
// filter. See skbug.com/7094.
SkASSERT(tex->texturePriv().mipmapped() != GrMipmapped::kYes ||
!tex->texturePriv().mipmapsAreDirty());
SkASSERT(tex->mipmapped() != GrMipmapped::kYes || !tex->mipmapsAreDirty());
}
}
#endif

View File

@ -23,7 +23,7 @@
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrResourceAllocator.h"
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/geometry/GrRect.h"
#include "src/gpu/ops/GrClearOp.h"

View File

@ -15,7 +15,7 @@
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"

View File

@ -22,7 +22,7 @@ GrStencilSettings GrProgramInfo::nonGLStencilSettings() const {
}
#ifdef SK_DEBUG
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
void GrProgramInfo::validate(bool flushTime) const {
if (flushTime) {
@ -47,8 +47,7 @@ void GrProgramInfo::checkMSAAAndMIPSAreResolved() const {
(tex->width() != 1 || tex->height() != 1)) {
// There are some cases where we might be given a non-mipmapped texture with a
// mipmap filter. See skbug.com/7094.
SkASSERT(tex->texturePriv().mipmapped() != GrMipmapped::kYes ||
!tex->texturePriv().mipmapsAreDirty());
SkASSERT(tex->mipmapped() != GrMipmapped::kYes || !tex->mipmapsAreDirty());
}
});
}

View File

@ -24,7 +24,7 @@
#include "src/gpu/GrResourceCache.h"
#include "src/gpu/GrSemaphore.h"
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGr.h"
const int GrResourceProvider::kMinScratchTextureSize = 16;
@ -263,8 +263,8 @@ sk_sp<GrTexture> GrResourceProvider::refScratchTexture(SkISize dimensions,
// to fall back to making a new texture.
if (fGpu->caps()->reuseScratchTextures() || renderable == GrRenderable::kYes) {
GrScratchKey key;
GrTexturePriv::ComputeScratchKey(*this->caps(), format, dimensions, renderable,
renderTargetSampleCnt, mipMapped, isProtected, &key);
GrTexture::ComputeScratchKey(*this->caps(), format, dimensions, renderable,
renderTargetSampleCnt, mipMapped, isProtected, &key);
GrGpuResource* resource = fCache->findAndRefScratchResource(key);
if (resource) {
fGpu->stats()->incNumScratchTexturesReused();

View File

@ -20,7 +20,7 @@
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureRenderTargetProxy.h"
#ifdef SK_DEBUG
@ -212,8 +212,8 @@ void GrSurfaceProxy::computeScratchKey(const GrCaps& caps, GrScratchKey* key) co
mipMapped = tp->mipmapped();
}
GrTexturePriv::ComputeScratchKey(caps, this->backendFormat(), this->backingStoreDimensions(),
renderable, sampleCount, mipMapped, fIsProtected, key);
GrTexture::ComputeScratchKey(caps, this->backendFormat(), this->backingStoreDimensions(),
renderable, sampleCount, mipMapped, fIsProtected, key);
}
SkISize GrSurfaceProxy::backingStoreDimensions() const {

View File

@ -15,7 +15,6 @@
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#ifdef SK_DEBUG
#include "include/gpu/GrDirectContext.h"
@ -36,7 +35,7 @@ void GrTexture::markMipmapsClean() {
size_t GrTexture::onGpuMemorySize() const {
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), 1,
this->texturePriv().mipmapped());
this->mipmapped());
}
/////////////////////////////////////////////////////////////////////////////
@ -94,20 +93,19 @@ void GrTexture::computeScratchKey(GrScratchKey* key) const {
renderable = GrRenderable::kYes;
}
auto isProtected = this->isProtected() ? GrProtected::kYes : GrProtected::kNo;
GrTexturePriv::ComputeScratchKey(*this->getGpu()->caps(), this->backendFormat(),
this->dimensions(), renderable, sampleCount,
this->texturePriv().mipmapped(), isProtected, key);
ComputeScratchKey(*this->getGpu()->caps(), this->backendFormat(), this->dimensions(),
renderable, sampleCount, this->mipmapped(), isProtected, key);
}
}
void GrTexturePriv::ComputeScratchKey(const GrCaps& caps,
const GrBackendFormat& format,
SkISize dimensions,
GrRenderable renderable,
int sampleCnt,
GrMipmapped mipMapped,
GrProtected isProtected,
GrScratchKey* key) {
void GrTexture::ComputeScratchKey(const GrCaps& caps,
const GrBackendFormat& format,
SkISize dimensions,
GrRenderable renderable,
int sampleCnt,
GrMipmapped mipMapped,
GrProtected isProtected,
GrScratchKey* key) {
static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType();
SkASSERT(!dimensions.isEmpty());
SkASSERT(sampleCnt > 0);

View File

@ -16,8 +16,6 @@
#include "include/private/GrTypesPriv.h"
#include "src/gpu/GrSurface.h"
class GrTexturePriv;
class GrTexture : virtual public GrSurface {
public:
GrTexture* asTexture() override { return this; }
@ -69,9 +67,28 @@ public:
this->addIdleProc(sk_make_sp<GrRefCntedCallback>(callback, context), state);
}
/** Access methods that are only to be used within Skia code. */
inline GrTexturePriv texturePriv();
inline const GrTexturePriv texturePriv() const;
GrTextureType textureType() const { return fTextureType; }
bool hasRestrictedSampling() const {
return GrTextureTypeHasRestrictedSampling(this->textureType());
}
void markMipmapsDirty();
void markMipmapsClean();
GrMipmapped mipmapped() const {
return GrMipmapped(fMipmapStatus != GrMipmapStatus::kNotAllocated);
}
bool mipmapsAreDirty() const { return fMipmapStatus != GrMipmapStatus::kValid; }
GrMipmapStatus mipmapStatus() const { return fMipmapStatus; }
int maxMipmapLevel() const { return fMaxMipmapLevel; }
static void ComputeScratchKey(const GrCaps& caps,
const GrBackendFormat& format,
SkISize dimensions,
GrRenderable,
int sampleCnt,
GrMipmapped,
GrProtected,
GrScratchKey* key);
protected:
GrTexture(GrGpu*, const SkISize&, GrProtected, GrTextureType, GrMipmapStatus);
@ -89,13 +106,10 @@ protected:
private:
size_t onGpuMemorySize() const override;
void markMipmapsDirty();
void markMipmapsClean();
GrTextureType fTextureType;
GrMipmapStatus fMipmapStatus;
int fMaxMipmapLevel;
friend class GrTexturePriv;
friend class GrTextureResource;
typedef GrSurface INHERITED;

View File

@ -1,78 +0,0 @@
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrTexturePriv_DEFINED
#define GrTexturePriv_DEFINED
#include "src/gpu/GrSamplerState.h"
#include "src/gpu/GrTexture.h"
/** Class that adds methods to GrTexture that are only intended for use internal to Skia.
This class is purely a privileged window into GrTexture. It should never have additional data
members or virtual methods.
Non-static methods that are not trivial inlines should be spring-boarded (e.g. declared and
implemented privately in GrTexture with a inline public method here). */
class GrTexturePriv {
public:
void markMipmapsDirty() {
fTexture->markMipmapsDirty();
}
void markMipmapsClean() {
fTexture->markMipmapsClean();
}
GrMipmapStatus mipmapStatus() const { return fTexture->fMipmapStatus; }
bool mipmapsAreDirty() const { return GrMipmapStatus::kValid != this->mipmapStatus(); }
GrMipmapped mipmapped() const {
if (GrMipmapStatus::kNotAllocated != this->mipmapStatus()) {
return GrMipmapped::kYes;
}
return GrMipmapped::kNo;
}
int maxMipmapLevel() const {
return fTexture->fMaxMipmapLevel;
}
GrTextureType textureType() const { return fTexture->fTextureType; }
bool hasRestrictedSampling() const {
return GrTextureTypeHasRestrictedSampling(this->textureType());
}
static void ComputeScratchKey(const GrCaps& caps,
const GrBackendFormat& format,
SkISize dimensions,
GrRenderable,
int sampleCnt,
GrMipmapped,
GrProtected,
GrScratchKey* key);
private:
GrTexturePriv(GrTexture* texture) : fTexture(texture) { }
GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { }
GrTexturePriv& operator=(const GrTexturePriv&); // unimpl
// No taking addresses of this type.
const GrTexturePriv* operator&() const;
GrTexturePriv* operator&();
GrTexture* fTexture;
friend class GrTexture; // to construct/copy this type.
};
inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); }
inline const GrTexturePriv GrTexture::texturePriv () const {
return GrTexturePriv(const_cast<GrTexture*>(this));
}
#endif

View File

@ -13,7 +13,7 @@
#include "src/gpu/GrDeferredProxyUploader.h"
#include "src/gpu/GrProxyProvider.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
// Deferred version - no data
GrTextureProxy::GrTextureProxy(const GrBackendFormat& format,
@ -64,8 +64,8 @@ GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf,
UseAllocator useAllocator,
GrDDLProvider creatingProvider)
: INHERITED(std::move(surf), SkBackingFit::kExact, useAllocator)
, fMipmapped(fTarget->asTexture()->texturePriv().mipmapped())
, fMipmapStatus(fTarget->asTexture()->texturePriv().mipmapStatus())
, fMipmapped(fTarget->asTexture()->mipmapped())
, fMipmapStatus(fTarget->asTexture()->mipmapStatus())
SkDEBUGCODE(, fInitialMipmapStatus(fMipmapStatus))
, fCreatingProvider(creatingProvider)
, fProxyProvider(nullptr)
@ -137,7 +137,7 @@ void GrTextureProxyPriv::resetDeferredUploader() {
GrMipmapped GrTextureProxy::mipmapped() const {
if (this->isInstantiated()) {
return this->peekTexture()->texturePriv().mipmapped();
return this->peekTexture()->mipmapped();
}
return fMipmapped;
}
@ -205,9 +205,9 @@ void GrTextureProxy::onValidateSurface(const GrSurface* surface) {
SkASSERT(surface->asTexture());
// It is possible to fulfill a non-mipmapped proxy with a mipmapped texture.
SkASSERT(GrMipmapped::kNo == this->proxyMipmapped() ||
GrMipmapped::kYes == surface->asTexture()->texturePriv().mipmapped());
GrMipmapped::kYes == surface->asTexture()->mipmapped());
SkASSERT(surface->asTexture()->texturePriv().textureType() == this->textureType());
SkASSERT(surface->asTexture()->textureType() == this->textureType());
GrInternalSurfaceFlags proxyFlags = fSurfaceFlags;
GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags();

View File

@ -13,7 +13,6 @@
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxyPriv.h"
#ifdef SK_DEBUG
@ -178,13 +177,13 @@ void GrTextureRenderTargetProxy::onValidateSurface(const GrSurface* surface) {
// Anything checked here should also be checking the GrTextureProxy version
SkASSERT(surface->asTexture());
SkASSERT(GrMipmapped::kNo == this->proxyMipmapped() ||
GrMipmapped::kYes == surface->asTexture()->texturePriv().mipmapped());
GrMipmapped::kYes == surface->asTexture()->mipmapped());
// Anything checked here should also be checking the GrRenderTargetProxy version
SkASSERT(surface->asRenderTarget());
SkASSERT(surface->asRenderTarget()->numSamples() == this->numSamples());
SkASSERT(surface->asTexture()->texturePriv().textureType() == this->textureType());
SkASSERT(surface->asTexture()->textureType() == this->textureType());
GrInternalSurfaceFlags proxyFlags = fSurfaceFlags;
GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags();

View File

@ -12,7 +12,7 @@
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrResourceAllocator.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
void GrTextureResolveRenderTask::addProxy(GrDrawingManager* drawingMgr,
sk_sp<GrSurfaceProxy> proxyRef,
@ -81,9 +81,9 @@ bool GrTextureResolveRenderTask::onExecute(GrOpFlushState* flushState) {
if (GrSurfaceProxy::ResolveFlags::kMipMaps & resolve.fFlags) {
// peekTexture might be null if there was an instantiation error.
GrTexture* texture = this->target(i).proxy()->peekTexture();
if (texture && texture->texturePriv().mipmapsAreDirty()) {
if (texture && texture->mipmapsAreDirty()) {
flushState->gpu()->regenerateMipMapLevels(texture);
SkASSERT(!texture->texturePriv().mipmapsAreDirty());
SkASSERT(!texture->mipmapsAreDirty());
}
}
}

View File

@ -10,7 +10,6 @@
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrOpsRenderPass.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/ccpr/GrCCPerFlushResources.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"

View File

@ -13,7 +13,7 @@
#include "src/core/SkMipmap.h"
#include "src/gpu/GrBackendUtils.h"
#include "src/gpu/GrDataUtils.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/d3d/GrD3DBuffer.h"
#include "src/gpu/d3d/GrD3DCaps.h"
#include "src/gpu/d3d/GrD3DOpsRenderPass.h"
@ -621,7 +621,7 @@ bool GrD3DGpu::onWritePixels(GrSurface* surface, int left, int top, int width, i
// Need to change the resource state to COPY_DEST in order to upload to it
d3dTex->setResourceState(this, D3D12_RESOURCE_STATE_COPY_DEST);
SkASSERT(mipLevelCount <= d3dTex->texturePriv().maxMipmapLevel() + 1);
SkASSERT(mipLevelCount <= d3dTex->maxMipmapLevel() + 1);
success = this->uploadToTexture(d3dTex, left, top, width, height, srcColorType, texels,
mipLevelCount);
@ -641,7 +641,7 @@ bool GrD3DGpu::uploadToTexture(GrD3DTexture* tex, int left, int top, int width,
// We assume that if the texture has mip levels, we either upload to all the levels or just the
// first.
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1));
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1));
if (width == 0 || height == 0) {
return false;
@ -719,7 +719,7 @@ bool GrD3DGpu::uploadToTexture(GrD3DTexture* tex, int left, int top, int width,
placedFootprints.get(), left, top);
if (mipLevelCount < (int)desc.MipLevels) {
tex->texturePriv().markMipmapsDirty();
tex->markMipmapsDirty();
}
return true;

View File

@ -7,7 +7,7 @@
#include "src/gpu/d3d/GrD3DTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/d3d/GrD3DGpu.h"
#include "src/gpu/d3d/GrD3DUtil.h"

View File

@ -7,7 +7,7 @@
#include "src/gpu/d3d/GrD3DTextureRenderTarget.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/d3d/GrD3DGpu.h"
GrD3DTextureRenderTarget::GrD3DTextureRenderTarget(
@ -181,5 +181,5 @@ size_t GrD3DTextureRenderTarget::onGpuMemorySize() const {
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
numColorSamples, // TODO: this still correct?
this->texturePriv().mipmapped());
this->mipmapped());
}

View File

@ -19,7 +19,7 @@
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrSemaphore.h"
#include "src/gpu/GrStencilSettings.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/dawn/GrDawnBuffer.h"
#include "src/gpu/dawn/GrDawnCaps.h"
#include "src/gpu/dawn/GrDawnOpsRenderPass.h"

View File

@ -10,7 +10,7 @@
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/dawn/GrDawnBuffer.h"
#include "src/gpu/dawn/GrDawnGpu.h"
#include "src/gpu/dawn/GrDawnProgramBuilder.h"

View File

@ -8,7 +8,7 @@
#include "src/gpu/dawn/GrDawnTextureRenderTarget.h"
#include "include/core/SkTraceMemoryDump.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/dawn/GrDawnGpu.h"
GrDawnTextureRenderTarget::GrDawnTextureRenderTarget(GrDawnGpu* gpu,
@ -29,6 +29,6 @@ bool GrDawnTextureRenderTarget::canAttemptStencilAttachment() const {
size_t GrDawnTextureRenderTarget::onGpuMemorySize() const {
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
1, // FIXME: for MSAA
this->texturePriv().mipmapped());
1, // FIXME: for MSAA
this->mipmapped());
}

View File

@ -9,7 +9,6 @@
#include "src/core/SkMatrixPriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/effects/GrMatrixEffect.h"
#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
#include "src/sksl/SkSLCPP.h"
@ -714,7 +713,7 @@ void GrTextureEffect::Impl::onSetData(const GrGLSLProgramDataManager& pdm,
const auto& s = te.fSubset;
const auto& c = te.fClamp;
auto type = te.texture()->texturePriv().textureType();
auto type = te.texture()->textureType();
float norm[4] = {w, h, 1.f/w, 1.f/h};

View File

@ -5,8 +5,9 @@
* found in the LICENSE file.
*/
#include "src/gpu/gl/GrGLGpu.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkStrokeRec.h"
#include "include/core/SkTypes.h"
#include "include/gpu/GrBackendSemaphore.h"
#include "include/gpu/GrBackendSurface.h"
@ -17,7 +18,6 @@
#include "include/private/SkTo.h"
#include "src/core/SkAutoMalloc.h"
#include "src/core/SkCompressedDataUtils.h"
#include "src/core/SkConvertPixels.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/GrBackendUtils.h"
@ -30,9 +30,8 @@
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/gl/GrGLBuffer.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLOpsRenderPass.h"
#include "src/gpu/gl/GrGLSemaphore.h"
#include "src/gpu/gl/GrGLStencilAttachment.h"
@ -2599,11 +2598,10 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz
}
if (samplerState.mipmapped() == GrMipmapped::kYes) {
if (!this->caps()->mipmapSupport() ||
texture->texturePriv().mipmapped() == GrMipmapped::kNo) {
if (!this->caps()->mipmapSupport() || texture->mipmapped() == GrMipmapped::kNo) {
samplerState.setMipmapMode(GrSamplerState::MipmapMode::kNone);
} else {
SkASSERT(!texture->texturePriv().mipmapsAreDirty());
SkASSERT(!texture->mipmapsAreDirty());
}
}
@ -2679,7 +2677,7 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz
}
GrGLTextureParameters::NonsamplerState newNonsamplerState;
newNonsamplerState.fBaseMipMapLevel = 0;
newNonsamplerState.fMaxMipmapLevel = texture->texturePriv().maxMipmapLevel();
newNonsamplerState.fMaxMipmapLevel = texture->maxMipmapLevel();
const GrGLTextureParameters::NonsamplerState& oldNonsamplerState =
texture->parameters()->nonsamplerState();
@ -2704,7 +2702,7 @@ void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const GrSwiz
}
// These are not supported in ES2 contexts
if (this->glCaps().mipmapLevelAndLodControlSupport() &&
(texture->texturePriv().textureType() != GrTextureType::kExternal ||
(texture->textureType() != GrTextureType::kExternal ||
!this->glCaps().dontSetBaseOrMaxLevelForExternalTextures())) {
if (newNonsamplerState.fBaseMipMapLevel != oldNonsamplerState.fBaseMipMapLevel) {
this->setTextureUnit(unitIdx);
@ -2825,11 +2823,11 @@ static inline bool can_blit_framebuffer_for_copy_surface(const GrSurface* dst,
GrTextureType srcTexType;
GrTextureType* srcTexTypePtr = nullptr;
if (dstTex) {
dstTexType = dstTex->texturePriv().textureType();
dstTexType = dstTex->textureType();
dstTexTypePtr = &dstTexType;
}
if (srcTex) {
srcTexType = srcTex->texturePriv().textureType();
srcTexType = srcTex->textureType();
srcTexTypePtr = &srcTexType;
}
@ -2865,11 +2863,11 @@ static inline bool can_copy_texsubimage(const GrSurface* dst, const GrSurface* s
GrTextureType srcTexType;
GrTextureType* srcTexTypePtr = nullptr;
if (dstTex) {
dstTexType = dstTex->texturePriv().textureType();
dstTexType = dstTex->textureType();
dstTexTypePtr = &dstTexType;
}
if (srcTex) {
srcTexType = srcTex->texturePriv().textureType();
srcTexType = srcTex->textureType();
srcTexTypePtr = &srcTexType;
}
@ -3010,8 +3008,7 @@ bool GrGLGpu::createCopyProgram(GrTexture* srcTex) {
int progIdx = TextureToCopyProgramIdx(srcTex);
const GrShaderCaps* shaderCaps = this->caps()->shaderCaps();
GrSLType samplerType =
GrSLCombinedSamplerTypeForTextureType(srcTex->texturePriv().textureType());
GrSLType samplerType = GrSLCombinedSamplerTypeForTextureType(srcTex->textureType());
if (!fCopyProgramArrayBuffer) {
static const GrGLfloat vdata[] = {
@ -3321,7 +3318,7 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst, GrSurface* src, const SkIRect& s
GrGLfloat sy1 = (GrGLfloat)(srcRect.fTop + h);
int sw = src->width();
int sh = src->height();
if (srcTex->texturePriv().textureType() != GrTextureType::kRectangle) {
if (srcTex->textureType() != GrTextureType::kRectangle) {
// src rect edges in normalized texture space (0 to 1)
sx0 /= sw;
sx1 /= sw;
@ -3429,7 +3426,7 @@ bool GrGLGpu::onRegenerateMipMapLevels(GrTexture* texture) {
int width = texture->width();
int height = texture->height();
int levelCount = SkMipmap::ComputeLevelCount(width, height) + 1;
SkASSERT(levelCount == texture->texturePriv().maxMipmapLevel() + 1);
SkASSERT(levelCount == texture->maxMipmapLevel() + 1);
// Create (if necessary), then bind temporary FBO:
if (0 == fTempDstFBOID) {
@ -4037,7 +4034,7 @@ std::unique_ptr<GrSemaphore> GrGLGpu::prepareTextureForCrossContextUsage(GrTextu
}
int GrGLGpu::TextureToCopyProgramIdx(GrTexture* texture) {
switch (GrSLCombinedSamplerTypeForTextureType(texture->texturePriv().textureType())) {
switch (GrSLCombinedSamplerTypeForTextureType(texture->textureType())) {
case kTexture2DSampler_GrSLType:
return 0;
case kTexture2DRectSampler_GrSLType:

View File

@ -5,16 +5,17 @@
* found in the LICENSE file.
*/
#include "src/gpu/gl/GrGLProgram.h"
#include "src/gpu/GrPathProcessor.h"
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrProcessor.h"
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrXferProcessor.h"
#include "src/gpu/gl/GrGLBuffer.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLPathRendering.h"
#include "src/gpu/gl/GrGLProgram.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLXferProcessor.h"

View File

@ -5,12 +5,13 @@
* found in the LICENSE file.
*/
#include "src/gpu/gl/GrGLTexture.h"
#include "include/core/SkTraceMemoryDump.h"
#include "src/gpu/GrSemaphore.h"
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLTexture.h"
#define GPUGL static_cast<GrGLGpu*>(this->getGpu())
#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
@ -88,9 +89,7 @@ void GrGLTexture::init(const Desc& desc) {
fTextureIDOwnership = desc.fOwnership;
}
GrGLenum GrGLTexture::target() const {
return target_from_texture_type(this->texturePriv().textureType());
}
GrGLenum GrGLTexture::target() const { return target_from_texture_type(this->textureType()); }
void GrGLTexture::onRelease() {
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
@ -111,16 +110,15 @@ void GrGLTexture::onAbandon() {
GrBackendTexture GrGLTexture::getBackendTexture() const {
GrGLTextureInfo info;
info.fTarget = target_from_texture_type(this->texturePriv().textureType());
info.fTarget = target_from_texture_type(this->textureType());
info.fID = fID;
info.fFormat = GrGLFormatToEnum(fFormat);
return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipmapped(), info,
fParameters);
return GrBackendTexture(this->width(), this->height(), this->mipmapped(), info, fParameters);
}
GrBackendFormat GrGLTexture::backendFormat() const {
return GrBackendFormat::MakeGL(GrGLFormatToEnum(fFormat),
target_from_texture_type(this->texturePriv().textureType()));
target_from_texture_type(this->textureType()));
}
sk_sp<GrGLTexture> GrGLTexture::MakeWrapped(GrGLGpu* gpu,

View File

@ -5,12 +5,13 @@
* found in the LICENSE file.
*/
#include "src/gpu/gl/GrGLTextureRenderTarget.h"
#include "include/core/SkTraceMemoryDump.h"
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLTextureRenderTarget.h"
GrGLTextureRenderTarget::GrGLTextureRenderTarget(GrGLGpu* gpu,
SkBudgeted budgeted,
@ -73,5 +74,5 @@ sk_sp<GrGLTextureRenderTarget> GrGLTextureRenderTarget::MakeWrapped(
size_t GrGLTextureRenderTarget::onGpuMemorySize() const {
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
this->numSamplesOwnedPerPixel(), this->texturePriv().mipmapped());
this->numSamplesOwnedPerPixel(), this->mipmapped());
}

View File

@ -7,7 +7,7 @@
#include "src/gpu/gl/GrGLUniformHandler.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/gl/GrGLCaps.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/builders/GrGLProgramBuilder.h"

View File

@ -11,7 +11,7 @@
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLVarying.h"

View File

@ -10,7 +10,7 @@
#include "src/gpu/GrOpsRenderPass.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/mock/GrMockGpu.h"
class GrMockOpsRenderPass : public GrOpsRenderPass {
@ -55,7 +55,7 @@ private:
}
void markRenderTargetDirty() {
if (auto* tex = fRenderTarget->asTexture()) {
tex->texturePriv().markMipmapsDirty();
tex->markMipmapsDirty();
}
}

View File

@ -12,7 +12,6 @@
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/mock/GrMockGpu.h"
class GrMockTexture : public GrTexture {
@ -44,8 +43,7 @@ public:
~GrMockTexture() override {}
GrBackendTexture getBackendTexture() const override {
return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipmapped(),
fInfo);
return GrBackendTexture(this->width(), this->height(), this->mipmapped(), fInfo);
}
GrBackendFormat backendFormat() const override {
@ -210,7 +208,7 @@ private:
}
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
numColorSamples, this->texturePriv().mipmapped());
numColorSamples, this->mipmapped());
}
// This avoids an inherits via dominance warning on MSVC.

View File

@ -14,7 +14,7 @@
#include "src/gpu/GrBackendUtils.h"
#include "src/gpu/GrDataUtils.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/mtl/GrMtlBuffer.h"
#include "src/gpu/mtl/GrMtlCommandBuffer.h"
#include "src/gpu/mtl/GrMtlOpsRenderPass.h"
@ -237,7 +237,7 @@ bool GrMtlGpu::uploadToTexture(GrMtlTexture* tex, int left, int top, int width,
// We assume that if the texture has mip levels, we either upload to all the levels or just the
// first.
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1));
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1));
if (!check_max_blit_width(width)) {
return false;
@ -316,7 +316,7 @@ bool GrMtlGpu::uploadToTexture(GrMtlTexture* tex, int left, int top, int width,
#endif
if (mipLevelCount < (int) tex->mtlTexture().mipmapLevelCount) {
tex->texturePriv().markMipmapsDirty();
tex->markMipmapsDirty();
}
return true;
@ -403,7 +403,7 @@ bool GrMtlGpu::clearTexture(GrMtlTexture* tex, size_t bpp, uint32_t levelMask) {
}
if (mipLevelCount < (int) tex->mtlTexture().mipmapLevelCount) {
tex->texturePriv().markMipmapsDirty();
tex->markMipmapsDirty();
}
return true;

View File

@ -10,7 +10,7 @@
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLXferProcessor.h"

View File

@ -7,7 +7,7 @@
#include "src/gpu/mtl/GrMtlTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/mtl/GrMtlGpu.h"
#include "src/gpu/mtl/GrMtlUtil.h"

View File

@ -6,7 +6,6 @@
*/
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
#include "src/gpu/mtl/GrMtlUniformHandler.h"

View File

@ -27,7 +27,6 @@
#include "src/gpu/GrResourceProviderPriv.h"
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/effects/GrXfermodeFragmentProcessor.h"

View File

@ -24,7 +24,7 @@
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrRenderTargetPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGpuDevice.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/vk/GrVkAMDMemoryAllocator.h"
@ -466,7 +466,7 @@ bool GrVkGpu::onWritePixels(GrSurface* surface, int left, int top, int width, in
success = this->uploadTexDataLinear(vkTex, left, top, width, height, srcColorType,
texels[0].fPixels, texels[0].fRowBytes);
} else {
SkASSERT(mipLevelCount <= vkTex->texturePriv().maxMipmapLevel() + 1);
SkASSERT(mipLevelCount <= vkTex->maxMipmapLevel() + 1);
success = this->uploadTexDataOptimal(vkTex, left, top, width, height, srcColorType, texels,
mipLevelCount);
}
@ -544,7 +544,7 @@ bool GrVkGpu::onTransferPixelsTo(GrTexture* texture, int left, int top, int widt
1,
&region);
vkTex->texturePriv().markMipmapsDirty();
vkTex->markMipmapsDirty();
return true;
}
@ -784,7 +784,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int widt
// We assume that if the texture has mip levels, we either upload to all the levels or just the
// first.
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->texturePriv().maxMipmapLevel() + 1));
SkASSERT(1 == mipLevelCount || mipLevelCount == (tex->maxMipmapLevel() + 1));
if (width == 0 || height == 0) {
return false;
@ -952,7 +952,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, int left, int top, int widt
SkIPoint::Make(left, top)));
}
if (1 == mipLevelCount) {
tex->texturePriv().markMipmapsDirty();
tex->markMipmapsDirty();
}
return true;
@ -1422,7 +1422,7 @@ bool GrVkGpu::onRegenerateMipMapLevels(GrTexture* tex) {
SkDebugf("Trying to create mipmap for linear tiled texture");
return false;
}
SkASSERT(tex->texturePriv().textureType() == GrTextureType::k2D);
SkASSERT(tex->textureType() == GrTextureType::k2D);
// determine if we can blit to and from this format
const GrVkCaps& caps = this->vkCaps();

View File

@ -10,7 +10,7 @@
#include "src/core/SkMipmap.h"
#include "src/gpu/GrPipeline.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLXferProcessor.h"

View File

@ -7,7 +7,7 @@
#include "src/gpu/vk/GrVkTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/vk/GrVkDescriptorSet.h"
#include "src/gpu/vk/GrVkGpu.h"
#include "src/gpu/vk/GrVkImageView.h"

View File

@ -7,7 +7,7 @@
#include "src/gpu/vk/GrVkTextureRenderTarget.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/vk/GrVkGpu.h"
#include "src/gpu/vk/GrVkImageView.h"
#include "src/gpu/vk/GrVkUtil.h"
@ -255,5 +255,5 @@ size_t GrVkTextureRenderTarget::onGpuMemorySize() const {
const GrCaps& caps = *this->getGpu()->caps();
return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
numColorSamples, // TODO: this still correct?
this->texturePriv().mipmapped());
this->mipmapped());
}

View File

@ -7,7 +7,7 @@
#include "src/gpu/vk/GrVkUniformHandler.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
#include "src/gpu/vk/GrVkGpu.h"
#include "src/gpu/vk/GrVkPipelineStateBuilder.h"

View File

@ -38,7 +38,6 @@
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureAdjuster.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/SkGr.h"

View File

@ -12,7 +12,6 @@
#include "src/gpu/GrShaderCaps.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTextureProxyPriv.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/gl/GrGLUtil.h"
@ -182,13 +181,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) {
GrTextureProxy* proxy = surfaceContext->asTextureProxy();
REPORTER_ASSERT(reporter, proxy->mipmapped() == GrMipmapped::kNo);
REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().mipmapped() == GrMipmapped::kNo);
REPORTER_ASSERT(reporter, proxy->peekTexture()->mipmapped() == GrMipmapped::kNo);
REPORTER_ASSERT(reporter, proxy->textureType() == GrTextureType::kExternal);
REPORTER_ASSERT(reporter,
proxy->peekTexture()->texturePriv().textureType() == GrTextureType::kExternal);
REPORTER_ASSERT(reporter, proxy->peekTexture()->textureType() == GrTextureType::kExternal);
REPORTER_ASSERT(reporter, proxy->hasRestrictedSampling());
REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().hasRestrictedSampling());
REPORTER_ASSERT(reporter, proxy->peekTexture()->hasRestrictedSampling());
// Should not be able to wrap as a RT
{

View File

@ -21,7 +21,7 @@
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSemaphore.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGpuDevice.h"
#include "src/image/SkImage_Base.h"
@ -92,14 +92,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
}
if (GrMipmapped::kYes == mipMapped) {
REPORTER_ASSERT(reporter, GrMipmapped::kYes == texture->texturePriv().mipmapped());
REPORTER_ASSERT(reporter, GrMipmapped::kYes == texture->mipmapped());
if (GrRenderable::kYes == renderable) {
REPORTER_ASSERT(reporter, texture->texturePriv().mipmapsAreDirty());
REPORTER_ASSERT(reporter, texture->mipmapsAreDirty());
} else {
REPORTER_ASSERT(reporter, !texture->texturePriv().mipmapsAreDirty());
REPORTER_ASSERT(reporter, !texture->mipmapsAreDirty());
}
} else {
REPORTER_ASSERT(reporter, GrMipmapped::kNo == texture->texturePriv().mipmapped());
REPORTER_ASSERT(reporter, GrMipmapped::kNo == texture->mipmapped());
}
context->deleteBackendTexture(backendTex);
}
@ -288,7 +288,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
texProxy->instantiate(resourceProvider);
GrTexture* texture = texProxy->peekTexture();
REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipmapped());
REPORTER_ASSERT(reporter, mipMapped == texture->mipmapped());
sk_sp<SkImage> image = surface->makeImageSnapshot();
REPORTER_ASSERT(reporter, image);
@ -300,7 +300,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
texProxy->instantiate(resourceProvider);
texture = texProxy->peekTexture();
REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipmapped());
REPORTER_ASSERT(reporter, mipMapped == texture->mipmapped());
// Must flush the context to make sure all the cmds (copies, etc.) from above are sent
// to the gpu before we delete the backendHandle.

View File

@ -20,7 +20,6 @@
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTexturePriv.h"
#include "tests/Test.h"
#include "tests/TestUtils.h"
@ -422,7 +421,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadOnlyTexture, reporter, context_info) {
proxy = proxyProvider->wrapBackendTexture(backendTex, kBorrow_GrWrapOwnership,
GrWrapCacheable::kNo, ioType);
context->flushAndSubmit();
proxy->peekTexture()->texturePriv().markMipmapsDirty(); // avoids assert in GrGpu.
proxy->peekTexture()->markMipmapsDirty(); // avoids assert in GrGpu.
auto regenResult =
context->priv().getGpu()->regenerateMipMapLevels(proxy->peekTexture());
REPORTER_ASSERT(reporter, regenResult == (ioType == kRW_GrIOType));

View File

@ -9,7 +9,7 @@
#include "include/core/SkSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/image/SkImage_Base.h"
#include "src/image/SkImage_GpuBase.h"
#include "tests/Test.h"
@ -24,12 +24,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrTextureMipMapInvalidationTest, reporter, ct
auto isMipped = [] (SkSurface* surf) {
SkImage_GpuBase* image = static_cast<SkImage_GpuBase*>(as_IB(surf->makeImageSnapshot()));
const GrTexture* texture = image->getTexture();
return GrMipmapped::kYes == texture->texturePriv().mipmapped();
return GrMipmapped::kYes == texture->mipmapped();
};
auto mipsAreDirty = [] (SkSurface* surf) {
SkImage_GpuBase* image = static_cast<SkImage_GpuBase*>(as_IB(surf->makeImageSnapshot()));
return image->getTexture()->texturePriv().mipmapsAreDirty();
return image->getTexture()->mipmapsAreDirty();
};
auto info = SkImageInfo::MakeN32Premul(256, 256);

View File

@ -14,7 +14,7 @@
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSurfaceContextPriv.h"
#include "src/gpu/GrSurfacePriv.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/SkGr.h"
#ifdef SK_GL
#include "src/gpu/gl/GrGLGpu.h"
@ -165,13 +165,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(RectangleTexture, reporter, ctxInfo) {
}
SkASSERT(rectProxy->mipmapped() == GrMipmapped::kNo);
SkASSERT(rectProxy->peekTexture()->texturePriv().mipmapped() == GrMipmapped::kNo);
SkASSERT(rectProxy->peekTexture()->mipmapped() == GrMipmapped::kNo);
SkASSERT(rectProxy->textureType() == GrTextureType::kRectangle);
SkASSERT(rectProxy->peekTexture()->texturePriv().textureType() ==
GrTextureType::kRectangle);
SkASSERT(rectProxy->peekTexture()->textureType() == GrTextureType::kRectangle);
SkASSERT(rectProxy->hasRestrictedSampling());
SkASSERT(rectProxy->peekTexture()->texturePriv().hasRestrictedSampling());
SkASSERT(rectProxy->peekTexture()->hasRestrictedSampling());
GrSwizzle swizzle = direct->priv().caps()->getReadSwizzle(rectangleTex.getBackendFormat(),
GrColorType::kRGBA_8888);